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

expect_column_max_to_be_between not working for Date column #9541

Open
franciskuttivelil opened this issue Feb 27, 2024 · 1 comment
Open

Comments

@franciskuttivelil
Copy link

Hello Support,

Getting the below error. The expectation works on other tables except the below. Have checked the table and cannot find anything different from other tables. Please help resolve this issue.

The expectation checks if the data in the table is fresh. It does that by checking if the date column has yesterday's date in it.
max(date) >= yesterday's date

Code:

validator.expect_column_max_to_be_between(column=date_col, min_value=(datetime.now()-timedelta(days=last_day_delta)).replace(hour=0, minute=0, second=0, microsecond=0))

Error:

expect_column_max_to_be_between raised an exception:
Metric ('column.max', 'a3473ad0fd2ad330bcda16b9b0353e40', 'parse_strings_as_datetimes=False') is not available for validation of { "expectation_type": "expect_column_max_to_be_between", "kwargs": { "column": "Date", "min_value": "2024-01-25 00:00:00", "batch_id": "ds_clientcode_clientname_google_ctv_datasource-ds_clientcode_clientname_google_ctv_data_asset" }, "meta": {} }. Please check your configuration.
Show exception traceback...

Traceback (most recent call last):
File "/usr/share/tomcat10/.local/lib/python3.11/site-packages/great_expectations/validator/validator.py", line 1074, in graph_validate
result = configuration.metrics_validate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/tomcat10/.local/lib/python3.11/site-packages/great_expectations/core/expectation_configuration.py", line 1494, in metrics_validate
return expectation_impl(self).metrics_validate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/tomcat10/.local/lib/python3.11/site-packages/great_expectations/expectations/expectation.py", line 1061, in metrics_validate
_validate_dependencies_against_available_metrics(
File "/usr/share/tomcat10/.local/lib/python3.11/site-packages/great_expectations/expectations/expectation.py", line 3739, in _validate_dependencies_against_available_metrics
raise InvalidExpectationConfigurationError(
great_expectations.exceptions.exceptions.InvalidExpectationConfigurationError: Metric ('column.max', 'a3473ad0fd2ad330bcda16b9b0353e40', 'parse_strings_as_datetimes=False') is not available for validation of {
"expectation_type": "expect_column_max_to_be_between",
"kwargs": {
"column": "Date",
"min_value": "2024-01-25 00:00:00",
"batch_id": "ds_clientcode_clientname_google_ctv_datasource-ds_clientcode_clientname_google_ctv_data_asset"
},
"meta": {}
}. Please check your configuration.

Thanks

Environment :

  • Operating System: Linux
  • Great Expectations Version: 0.18.7
  • Data Source: Pandas
  • Cloud environment: AWS
@franciskuttivelil
Copy link
Author

Did anyone get a chance to look at this issue?

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