Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to add expectations ExpectColumnValuesToNotBeNull & ExpectColumnValuesToBeUnique for same column of dataset. #10811

Open
sengaay opened this issue Dec 26, 2024 · 0 comments

Comments

@sengaay
Copy link

sengaay commented Dec 26, 2024

I am trying to add following two expectations in same suite on same column of a table:

  • ExpectColumnValuesToNotBeNull
  • ExpectColumnValuesToBeUnique

When I am doing so, only one expectation is getting added and second expectation does not show in the suite and neither its throwing any error.

Chunk of code for creating suite:

suite = context.suites.add(gx.core.expectation_suite.ExpectationSuite(name=f"{table_name}_expectation_suite"))
suite.add_expectation(gx.expectations.ExpectColumnValuesToNotBeNull(column='Id'))
suite.add_expectation(gx.expectations.ExpectColumnMaxToBeBetween(
column="Id",
min_value=1,
max_value=3
))
suite.add_expectation(gx.expectations.ExpectColumnValuesToBeUnique(column='Id'))

#Suite Definition:

{
"name": "dbo.auth_user_expectation_suite",
"id": "a3bb183c-f60d-4565-a3ce-1a79f448914e",
"expectations": [
{
"type": "expect_column_values_to_not_be_null",
"kwargs": {
"column": "Id"
},
"meta": {},
"id": "ef0e7d14-e713-459e-9f8b-c97754680e34"
},
{
"type": "expect_column_max_to_be_between",
"kwargs": {
"column": "Id",
"min_value": 1.0,
"max_value": 3.0
},
"meta": {},
"id": "446d352d-d6b9-4610-810f-009c97649c4e"
}
],
"meta": {
"great_expectations_version": "1.3.0"
},
"notes": null
}

Expectation ExpectColumnValuesToBeUnique is missing from suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant