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
When we upgraded to the latest version it seems the suggested behaviour for parsing strings doesn't allow it to be a negative value relative to epoch.
In [8]: arrow.get(-1565358758)
Out[8]: <Arrow [1920-05-25T10:07:22+00:00]>
In [9]: arrow.get('-1565358758', 'X')
---------------------------------------------------------------------------
ParserMatchError Traceback (most recent call last)
<ipython-input-9-9ca34c371f99> in <module>
----> 1 arrow.get('-1565358758', 'X')
/usr/local/lib/python3.7/site-packages/arrow/api.py in get(*args, **kwargs)
19 """
20
---> 21 return _factory.get(*args, **kwargs)
22
23
/usr/local/lib/python3.7/site-packages/arrow/factory.py in get(self, *args, **kwargs)
228 # (str, format) -> parse.
229 elif isstr(arg_1) and (isstr(arg_2) or isinstance(arg_2, list)):
--> 230 dt = parser.DateTimeParser(locale).parse(args[0], args[1])
231 return self.type.fromdatetime(dt, tzinfo=tz)
232
/usr/local/lib/python3.7/site-packages/arrow/parser.py in parse(self, datetime_string, fmt)
214 if match is None:
215 raise ParserMatchError(
--> 216 "Failed to match '{}' when parsing '{}'".format(fmt, datetime_string)
217 )
218
ParserMatchError: Failed to match 'X' when parsing '-1565358758'
The text was updated successfully, but these errors were encountered:
JBKahn
changed the title
Arrow parse negative epoch on 0.15 not working for strings
Arrow parse negative number relative to epoch on 0.15 not working for strings
Sep 10, 2019
When we upgraded to the latest version it seems the suggested behaviour for parsing strings doesn't allow it to be a negative value relative to epoch.
The text was updated successfully, but these errors were encountered: