创建批处理并使用自定义查询不会将查询保存在 json 文件中
例如:
batch_kwargs = {'data_asset_name': 'pgsql.data_asset_name',
'query': 'select entity_id,attribute from table_name where attribute > 50 and',
'datasource': 'datasource',
'schema': 'public',
'table': 'table_name',
}
expectation_suite_name = "test.error"
suite = context.create_expectation_suite(
expectation_suite_name, overwrite_existing=True # Configure these parameters for your needs)
batch = context.get_batch(batch_kwargs, suite)
batch.expect_column_values_to_not_be_null('attribute', result_format={'result_format': 'COMPLETE','include_unexpected_rows': True})
batch.save_expectation_suite(discard_failed_expectations=False)
只会产生一个包含期望值的json,而不是batch_kwargs。
是否有配置来保存查询本身?