Skip to content

Commit

Permalink
Fix encoder for isoformat fields with null values
Browse files Browse the repository at this point in the history
  • Loading branch information
phenobarbital committed Mar 23, 2022
1 parent 7bf2bc0 commit be3fe1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion asyncdb/utils/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ def default(self, obj):
elif isinstance(obj, Decimal):
return str(obj)
elif hasattr(obj, "isoformat"):
return obj.isoformat()
try:
return obj.isoformat()
except TypeError:
return None
elif isinstance(obj, asyncpg.Range):
return [obj.lower, obj.upper]
else:
Expand Down
2 changes: 1 addition & 1 deletion asyncdb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__title__ = 'asyncdb'
__description__ = ('Library for Asynchronous data source connections '
'Collection of asyncio drivers.')
__version__ = '2.0.22'
__version__ = '2.0.23'
__author__ = 'Jesus Lara'
__author_email__ = 'jesuslarag@gmail.com'
__license__ = 'BSD'

0 comments on commit be3fe1b

Please sign in to comment.