Hi everyone,
I’m encountering an issue when trying to add multiple expectations for a single column in my Great Expectations suite. Specifically, when I add a new expectation for the column my_col
, only the first expectation is considered, and the subsequent ones are ignored.
here is how i defined the suite and expectations:
suite_name = “suite_name”
suite = ge.ExpectationSuite(suite_name)
suite = context.suites.add(suite)
suite.add_expectation(ge.expectations.ExpectColumnValuesToNotBeNull(column=‘myCol’))
suite.add_expectation(ge.expectations.ExpectColumnValuesToBeUnique(column=‘myCol’))
vd = ge.ValidationDefinition(
name=“my_vd”,
data=batch,
suite=suite,
)
checkpoint = ge.Checkpoint(
name=“my_checkpoint”,
validation_definitions=[vd],
actions=[ge.checkpoint.UpdateDataDocsAction(name=“update_data_docs”)]
)
context.validation_definitions.add(vd)
context.checkpoints.add(checkpoint)
results = checkpoint.run(batch_parameters={“dataframe”: df})