great_expectations icon indicating copy to clipboard operation
great_expectations copied to clipboard

Date to be between 2 date ranges

Open pmohancos opened this issue 1 year ago • 5 comments

Discussed in https://github.com/great-expectations/great_expectations/discussions/4276

Originally posted by kyleaton February 25, 2022 Hello!

It will be great to have an expectation that checks a date column to be between 2 date ranges.

pmohancos avatar Nov 23 '23 13:11 pmohancos

This should be possible using the expect_column_values_to_be_between expectation: https://greatexpectations.io/expectations/expect_column_values_to_be_between

You might have to set parse_strings_as_datetimes=True.

Chr96er avatar Nov 23 '23 15:11 Chr96er

This should be possible using the expect_column_values_to_be_between expectation: https://greatexpectations.io/expectations/expect_column_values_to_be_between

You might have to set parse_strings_as_datetimes=True.

I places parse_string_as_datetimes = True and it errors out. Is parse strings as date time deprecated or is it currently supported?

nicholaskebut1 avatar Nov 28 '23 08:11 nicholaskebut1

Same here, it is giving me an error message - could not convert string to float.

pmohancos avatar Nov 29 '23 06:11 pmohancos

Same here, it is giving me an error message - could not convert string to float.

Which version of great expectations are you using?

nicholaskebut1 avatar Nov 30 '23 09:11 nicholaskebut1

Sorry, for the late reply. I am using the version 0.18.3. I have written a custom expectation for this and is fulfilling my need now.

pmohancos avatar Dec 07 '23 09:12 pmohancos