Skip to content

Commit

Permalink
bugfix: decoding None values
Browse files Browse the repository at this point in the history
  • Loading branch information
idatsy committed Aug 24, 2024
1 parent 285949d commit b834eae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions py_questdb/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from py_questdb.db import QuestDB

__all__ = ['QuestDB']
4 changes: 3 additions & 1 deletion py_questdb/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def parse_and_yield_query_response(

for row in response.dataset:
converted_row = {
field.name: converter(value) for field, converter, value in zip(response.columns, type_converter, row)
field.name: converter(value) if value is not None else None
for field, converter, value
in zip(response.columns, type_converter, row)
}

yield into_type(**converted_row) if into_type else converted_row
Expand Down

0 comments on commit b834eae

Please sign in to comment.