Skip to content

Commit 94a51a7

Browse files
authored
Make cols_to_drop list dynamically created based on actual columns in df (#2414)
1 parent ee9ba65 commit 94a51a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/jobs/housing/housing_nec_migration_apply_gx_dq_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ def main():
7474
checkpoint_result = checkpoint.run(batch_parameters=batch_parameters)
7575
results_dict = list(checkpoint_result.run_results.values())[0].to_json_dict()
7676
table_results_df = pd.json_normalize(results_dict['results'])
77-
cols_to_drop = [c for c in table_results_df.columns if c.startswith('exception_info')]
78-
cols_to_drop.extend(['result.unexpected_list', 'result.details_mismatched', 'result.observed_value'])
77+
cols_not_needed = ['result.unexpected_list', 'result.details_mismatched', 'result.observed_value']
78+
cols_to_drop = [c for c in table_results_df.columns if c.startswith('exception_info') or c in cols_not_needed]
79+
7980
table_results_df = table_results_df.drop(columns=cols_to_drop)
8081
table_results_df_list.append(table_results_df)
8182

0 commit comments

Comments
 (0)