Skip to content

Commit

Permalink
Update json_parse_node.py
Browse files Browse the repository at this point in the history
Fixes numerical strings accidentally getting parsed to date
  • Loading branch information
Kobusvdwalt authored Dec 17, 2024
1 parent 43b1927 commit 33c0b6c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ def try_get_anything(self, value: Any) -> Any:
try:
if self.__is_four_digit_number(value):
return value

if value.isdigit():
return value
datetime_obj = pendulum.parse(value)
if isinstance(datetime_obj, pendulum.Duration):
return datetime_obj.as_timedelta()
Expand Down

0 comments on commit 33c0b6c

Please sign in to comment.