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
def _array_map_func(self, column):
element_mapping_func = self._col_func(column['arguments'][0]['value'])
return lambda values: [element_mapping_func(value) if value is not None else None for value in values]
Actual behavior
None in arrays cause TypeError: float() argument must be a string or a number, not 'NoneType'
Steps To Reproduce
query a real array column containing a mix of None and real values
Log output
File "/usr/local/lib/python3.9/site-packages/trino/dbapi.py", line 435, in execute
result = self._query.execute()
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 758, in execute
self._result.rows += self.fetch()
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 782, in fetch
return self._row_mapper.map(status.rows)
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 982, in map
return [self._map_row(row) for row in rows]
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 982, in <listcomp>
return [self._map_row(row) for row in rows]
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 985, in _map_row
return [self._map_value(value, self.columns[idx]) for idx, value in enumerate(row)]
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 985, in <listcomp>
return [self._map_value(value, self.columns[idx]) for idx, value in enumerate(row)]
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 992, in _map_value
return col_mapping_func(value)
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 892, in <lambda>
return lambda values: [element_mapping_func(value) for value in values]
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 892, in <listcomp>
return lambda values: [element_mapping_func(value) for value in values]
File "/usr/local/lib/python3.9/site-packages/trino/client.py", line 907, in <lambda>
else float(val)
TypeError: float() argument must be a string or a number, not 'NoneType'
Operating System
Bullseye
Trino Python client version
trino-0.318.0
Trino Server version
367
Python version
3.9
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Expected behavior
None values are mapped to
None
in_array_map_func
E.g
Actual behavior
None in arrays cause
TypeError: float() argument must be a string or a number, not 'NoneType'
Steps To Reproduce
query a real array column containing a mix of
None
and real valuesLog output
Operating System
Bullseye
Trino Python client version
trino-0.318.0
Trino Server version
367
Python version
3.9
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: