-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task 42: structure validator CLI output #47
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,7 @@ | |
import sys | ||
|
||
import pandas as pd | ||
from create_schemas import ( | ||
get_phase_1_schema_for_lei, | ||
get_phase_2_schema_for_lei, | ||
print_schema_errors, | ||
) | ||
from pandera.errors import SchemaErrors | ||
from create_schemas import validate_phases_by_lei | ||
|
||
|
||
def csv_to_df(path: str) -> pd.DataFrame: | ||
|
@@ -32,21 +27,7 @@ def run_validation_on_df(df: pd.DataFrame, lei: str) -> None: | |
print(df) | ||
print("") | ||
|
||
phase_1_failure_cases = None | ||
|
||
phase_1_sblar_schema = get_phase_1_schema_for_lei(lei) | ||
try: | ||
phase_1_sblar_schema(df, lazy=True) | ||
except SchemaErrors as errors: | ||
phase_1_failure_cases = errors.failure_cases | ||
print_schema_errors(errors, "Phase 1") | ||
|
||
if phase_1_failure_cases is None: | ||
phase_2_sblar_schema = get_phase_2_schema_for_lei(lei) | ||
try: | ||
phase_2_sblar_schema(df, lazy=True) | ||
except SchemaErrors as errors: | ||
print_schema_errors(errors, "Phase 2") | ||
print(validate_phases_by_lei(df, lei)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this |
||
|
||
|
||
if __name__ == "__main__": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: functions in #32 does not handle LEI so you'll need update them to handle LEI check