great-expectations / great_expectations

Always know what to expect from your data.
https://docs.greatexpectations.io/
Apache License 2.0
10k stars 1.55k forks source link

[MAINTENANCE] Write tests for misconfigured expectations error reporting #10696

Open cdkini opened 1 day ago

cdkini commented 1 day ago

Misconfigured expectations should fail with informative messages

For more information about contributing, visit our community resources.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

netlify[bot] commented 1 day ago

Deploy Preview for niobium-lead-7998 canceled.

Name Link
Latest commit 33996ef8a33afb04bde266bc45ee10d5695b2441
Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/673f5e98cee324000848596d
codecov[bot] commented 1 day ago

:x: 18 Tests Failed:

Tests completed Failed Passed Skipped
27382 18 27364 4782
View the top 3 failed tests by shortest run time > > ```python > tests.integration.data_sources_and_expectations.test_misconfigured_expectations::test_numeric_expectation_against_str_data_misconfiguration[sqlite] > ``` > >
Stack Traces | 0.156s run time > > > > > ```python > > batch_for_datasource = > > > > @parameterize_batch_for_data_sources( > > data_source_configs=ALL_DATA_SOURCES, > > data=pd.DataFrame({"a": ["b", "c"]}), > > ) > > def test_numeric_expectation_against_str_data_misconfiguration(batch_for_datasource) -> None: > > expectation = gxe.ExpectColumnStdevToBeBetween( > > column="a", > > min_value=0, > > max_value=1, > > strict_min=True, > > strict_max=True, > > ) > > result = batch_for_datasource.validate(expectation) > > assert not result.success > > > assert "could not convert string to float" in str(result.exception_info) > > E assert 'could not convert string to float' in "{'raised_exception': False, 'exception_traceback': None, 'exception_message': None}" > > E + where "{'raised_exception': False, 'exception_traceback': None, 'exception_message': None}" = str({'exception_message': None, 'exception_traceback': None, 'raised_exception': False}) > > E + where {'exception_message': None, 'exception_traceback': None, 'raised_exception': False} = {\n "success": false,\n "expectation_config": {\n "type": "expect_column_stdev_to_be_between",\n "kwargs": {\n "batch_id": "ypjyqamexb-fxneyflgni",\n "column": "a",\n "min_value": 0.0,\n "max_value": 1.0,\n "strict_min": true,\n "strict_max": true\n },\n "meta": {}\n },\n "result": {\n "observed_value": 0.0\n },\n "meta": {},\n "exception_info": {\n "raised_exception": false,\n "exception_traceback": null,\n "exception_message": null\n }\n}.exception_info > > > > .../integration/data_sources_and_expectations/test_misconfigured_expectations.py:26: AssertionError > > ``` > >
tests.integration.data_sources_and_expectations.test_misconfigured_expectations::test_numeric_expectation_against_str_data_misconfiguration[mysql]
Stack Traces | 0.195s run time > > ```python > batch_for_datasource = > > @parameterize_batch_for_data_sources( > data_source_configs=ALL_DATA_SOURCES, > data=pd.DataFrame({"a": ["b", "c"]}), > ) > def test_numeric_expectation_against_str_data_misconfiguration(batch_for_datasource) -> None: > expectation = gxe.ExpectColumnStdevToBeBetween( > column="a", > min_value=0, > max_value=1, > strict_min=True, > strict_max=True, > ) > result = batch_for_datasource.validate(expectation) > assert not result.success > > assert "could not convert string to float" in str(result.exception_info) > E assert 'could not convert string to float' in "{'raised_exception': False, 'exception_traceback': None, 'exception_message': None}" > E + where "{'raised_exception': False, 'exception_traceback': None, 'exception_message': None}" = str({'exception_message': None, 'exception_traceback': None, 'raised_exception': False}) > E + where {'exception_message': None, 'exception_traceback': None, 'raised_exception': False} = {\n "success": false,\n "expectation_config": {\n "type": "expect_column_stdev_to_be_between",\n "kwargs": {\n "batch_id": "jqrfsiucis-zbooltxxsg",\n "column": "a",\n "min_value": 0.0,\n "max_value": 1.0,\n "strict_min": true,\n "strict_max": true\n },\n "meta": {}\n },\n "result": {\n "observed_value": 0.0\n },\n "meta": {},\n "exception_info": {\n "raised_exception": false,\n "exception_traceback": null,\n "exception_message": null\n }\n}.exception_info > > .../integration/data_sources_and_expectations/test_misconfigured_expectations.py:26: AssertionError > ```
tests.integration.data_sources_and_expectations.test_misconfigured_expectations::test_numeric_expectation_against_str_data_misconfiguration[sqlite]
Stack Traces | 0.201s run time > > ```python > batch_for_datasource = > > @parameterize_batch_for_data_sources( > data_source_configs=ALL_DATA_SOURCES, > data=pd.DataFrame({"a": ["b", "c"]}), > ) > def test_numeric_expectation_against_str_data_misconfiguration(batch_for_datasource) -> None: > expectation = gxe.ExpectColumnStdevToBeBetween( > column="a", > min_value=0, > max_value=1, > strict_min=True, > strict_max=True, > ) > result = batch_for_datasource.validate(expectation) > assert not result.success > > assert "could not convert string to float" in str(result.exception_info) > E assert 'could not convert string to float' in "{'raised_exception': False, 'exception_traceback': None, 'exception_message': None}" > E + where "{'raised_exception': False, 'exception_traceback': None, 'exception_message': None}" = str({'exception_message': None, 'exception_traceback': None, 'raised_exception': False}) > E + where {'exception_message': None, 'exception_traceback': None, 'raised_exception': False} = {\n "success": false,\n "expectation_config": {\n "type": "expect_column_stdev_to_be_between",\n "kwargs": {\n "batch_id": "ypjyqamexb-fxneyflgni",\n "column": "a",\n "min_value": 0.0,\n "max_value": 1.0,\n "strict_min": true,\n "strict_max": true\n },\n "meta": {}\n },\n "result": {\n "observed_value": 0.0\n },\n "meta": {},\n "exception_info": {\n "raised_exception": false,\n "exception_traceback": null,\n "exception_message": null\n }\n}.exception_info > > .../integration/data_sources_and_expectations/test_misconfigured_expectations.py:26: AssertionError > ```

To view more test analytics, go to the Test Analytics Dashboard Got feedback? Let us know on Github