Closed pablofelt closed 2 weeks ago
Hi, my findings are similar. Here is another way to reproduce the issue:
import great_expectations as gx
context = gx.get_context()
validator = context.sources.pandas_default.read_csv(
"https://raw.githubusercontent.com/great-expectations/gx_tutorials/main/data/yellow_tripdata_sample_2019-01.csv"
)
# column map expectation
example1 = validator.expect_column_values_to_not_be_null(
"congestion_surcharge",
result_format={
"result_format": "COMPLETE",
"include_unexpected_rows": True,
},
)
assert example1.result["unexpected_rows"] is not None
# column_pair_map_expectation
example2 = validator.expect_column_pair_values_a_to_be_greater_than_b(
"congestion_surcharge",
"total_amount",
ignore_row_if="either_value_is_missing",
mostly=1.0,
or_equal=False,
row_condition=None,
result_format={
"result_format": "COMPLETE",
"include_unexpected_rows": True,
},
)
assert example2.result["unexpected_rows"] is not None
# column_aggregate_expectation
example3 = validator.expect_column_mean_to_be_between(
"vendor_id",
min_value=0.0,
max_value=1.0,
result_format={
"result_format": "COMPLETE",
"include_unexpected_rows": True,
},
)
assert example3.result["unexpected_rows"] is not None
checkpoint = gx.checkpoint.SimpleCheckpoint(
name="checkpoint-None-66438f03-4ea6-42db-8c86-02cd012e6213",
run_name_template="%Y%m%d-%H%M%S-compiled-checkpoint-template",
data_context=context,
validator=validator,
runtime_configuration={
"result_format": {
"result_format": "COMPLETE",
"include_unexpected_rows": True,
}
},
validations=[],
)
checkpoint_result = checkpoint.run()
validation_result_identifier = checkpoint_result.list_validation_result_identifiers()[0]
for x in checkpoint_result.run_results[next(iter(checkpoint_result.run_results))]["validation_result"].results:
assert x.result["unexpected_rows"] is not None, x.expectation_config["expectation_type"]
AFAIK the assertions above should pass
Hello @pablofelt. With the upcoming launch of Great Expectations Core (GX 1.0), we are closing old issues posted regarding previous versions. Moving forward, we will focus our resources on supporting and improving GX Core (version 1.0 and beyond). If you find that an issue you previously reported still exists in GX Core, we encourage you to resubmit it against the new version. With more resources dedicated to community support, we aim to tackle new issues swiftly. For specific details on what is GX-supported vs community-supported, you can reference our integration and support policy.
To get started on your transition to GX Core, check out the GX Core quickstart (click “Full example code” tab to see a code example).
You can also join our upcoming community meeting on August 28th at 9am PT (noon ET / 4pm UTC) for a comprehensive rundown of everything GX Core, plus Q&A as time permits. Go to https://greatexpectations.io/meetup and click “follow calendar” to follow the GX community calendar.
Thank you for being part of the GX community and thank you for submitting this issue. We're excited about this new chapter and look forward to your feedback on GX Core. 🤗
Describe the bug When I run a checkpoint with
subclasses of MulticolumnMapExpectation and ColumnPairMapExpectation both return
unexpected_rows=None
instead of returning the list of rows that failed validation.ColumnMapExpectation subclasses work fine (they return
unexpected_rows=[...]
as expected).To Reproduce Steps to reproduce the behavior:
expect_column_pair_values_a_to_be_greater_than_b
include_unexpected_rows=true
, e.g.,