Skip to content

Commit

Permalink
Create utils.create_pa_column() fn
Browse files Browse the repository at this point in the history
  • Loading branch information
sf-dcp committed Jan 10, 2025
1 parent cf8426d commit 025ff0b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dcpy/lifecycle/validate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ def create_pa_checks(checks: list[str | dict[str, CheckAttributes]]) -> list[pa.


def create_pa_column(column: Column) -> pa.Column:
raise NotImplementedError
"""Create Pandera column validator object."""
data_checks = create_pa_checks(column.checks) if column.checks else None
return pa.Column(
# TODO: implement `dtype` param
coerce=True, # coerce column to defined data type. This decision is up for debate
checks=data_checks,
required=column.is_required,
description=column.description,
nullable=True, # TODO: temp solution. Need to figure out what to do with this (equivalent to can be null)
)


def run_data_checks(
Expand Down

0 comments on commit 025ff0b

Please sign in to comment.