Skip to content

Commit

Permalink
Add table name, column name and expectation name separately to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bas committed Feb 15, 2025
1 parent 0770e49 commit 4ddba0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dq_suite/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ def _get_gx_expectation_object(validation_rule: Rule, table_name: str):
gx_expectation_parameters: dict = validation_rule["parameters"]
if "column" not in gx_expectation_parameters.keys():
gx_expectation_parameters["column"] = None
expectation_meta_data_identifier = \
f"{table_name}_{gx_expectation_parameters['column']}_{gx_expectation_name}"
gx_expectation_parameters["meta"] = {"identifier": expectation_meta_data_identifier}

gx_expectation_parameters["meta"] = {
"table_name": table_name,
"column_name": gx_expectation_parameters['column'],
"expectation_name": gx_expectation_name
}
return gx_expectation_class(**gx_expectation_parameters)

def add_expectations_to_suite(self, validation_rules_list: List[Rule]):
Expand Down

0 comments on commit 4ddba0f

Please sign in to comment.