Skip to content

Pandera question: Check format of date (yyyy-mm-dd) #1041

Answered by cosmicBboy
jonathangebru asked this question in Q&A
Discussion options

You must be logged in to vote

hi @jonathangebru, unfortunately schemas written in yaml aren't as flexible as Python ones...

I'm guessing you care about preserving the datatype of the datetime column? If not you can use the str_matches check: https://pandera.readthedocs.io/en/stable/reference/generated/methods/pandera.checks.Check.str_matches.html#pandera.checks.Check.str_matches

Perhaps a feature enhancement of that check is to convert incoming data into a str so that the regex pattern can be matched against the string-coerced data instead of the original datatype.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonathangebru
Comment options

Answer selected by jonathangebru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants