Skip to content

Commit 08efb63

Browse files
committed
Set schema to evolve in s3 to parquet function to avoid mismatched schema errors
1 parent dfca9c5 commit 08efb63

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,7 +74,7 @@ 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_not_needed = ['result.unexpected_list', 'result.details_mismatched', 'result.observed_value']
77+
cols_not_needed = ['result.unexpected_list', 'result.observed_value']
7878
cols_to_drop = [c for c in table_results_df.columns if c.startswith('exception_info') or c in cols_not_needed]
7979

8080
table_results_df = table_results_df.drop(columns=cols_to_drop)
@@ -127,7 +127,8 @@ def main():
127127
table=target_table,
128128
mode="overwrite_partitions",
129129
partition_cols=partition_keys,
130-
dtype=dtype_dict
130+
dtype=dtype_dict,
131+
schema_evolution=True
131132
)
132133

133134
logger.info(f'Data Quality test results for NEC data loads written to {s3_target_location}')

0 commit comments

Comments
 (0)