You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then I silently get the wrong result: for min, a datetime with today's date, and 00:04:00 as the time; for max, a datetime with today's date, and 00:03:00 as the time.
It looks like this is because snowfakery sends the value through dateutil.parser.parse() first (in template_funcs:parse_date()). For a days-back value like -120d, dateutil.parser.ParserError is raised so -120d gets passed to faker and everything works. For a months-back value like -3M, dateutil.parser doesn't raise ParserError and returns an unexpected datetime.
Expected behavior: snowfakery's date values support all of faker's formats. Note that snowfakery's documentation says values like -4m are supported for months, but this has the same output as described for -4M above, and if faker's formats were followed, -4m would be four minutes ago.
The text was updated successfully, but these errors were encountered:
While generating a date field with the
date_between
function block, I can use a min/max offset value of days, like the documentation says:but I can't use month as the unit for this offset, even though faker's date_time provider supports it. If I try:
Then I silently get the wrong result: for min, a datetime with today's date, and 00:04:00 as the time; for max, a datetime with today's date, and 00:03:00 as the time.
It looks like this is because snowfakery sends the value through
dateutil.parser.parse()
first (in template_funcs:parse_date()). For a days-back value like-120d
,dateutil.parser.ParserError
is raised so-120d
gets passed to faker and everything works. For a months-back value like-3M
, dateutil.parser doesn't raise ParserError and returns an unexpected datetime.Expected behavior: snowfakery's date values support all of faker's formats. Note that snowfakery's documentation says values like
-4m
are supported for months, but this has the same output as described for-4M
above, and if faker's formats were followed,-4m
would be four minutes ago.The text was updated successfully, but these errors were encountered: