Issue with Adding Multiple Expectations for a Single Column

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})

hi there, this should be fixed in out latest version, 1.3.2, please let me know if you are still experiencing this issue

Hi , i’m always experiencing the same issue even with the 1.3.2 version, only the first expectations is considered when i add two or more expectations for a same column.

I don’t know if could be an interesting test but you can try to switch the order of your expectations in the expectation suite and execute the checkpoint (or a validation definition). Hope it helps :crossed_fingers:

without sharing your script or environment, I’m not able further look into what could be causing the issue but the issue the original poster was facing sounded like an issue in which a few differing expectations where being evaluated as the same expectations, thus not being evaluated, but this has since been resolved.