Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
add check for isdidgit
Browse files Browse the repository at this point in the history
  • Loading branch information
shemogumbe committed Sep 10, 2024
1 parent 6714ba8 commit 6544b52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kiota_serialization_json/json_parse_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ def try_get_anything(self, value: Any) -> Any:
return dict(map(lambda x: (x[0], self.try_get_anything(x[1])), value.items()))
if isinstance(value, str):
try:

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 6544b52

Please sign in to comment.