We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66fbad6 commit 5d8866aCopy full SHA for 5d8866a
ibis/backends/duckdb/registry.py
@@ -176,7 +176,9 @@ def _literal(t, op):
176
value = op.value
177
178
if value is None:
179
- return sa.null()
+ return (
180
+ sa.null() if dtype.is_null() else sa.cast(sa.null(), t.get_sqla_type(dtype))
181
+ )
182
183
sqla_type = t.get_sqla_type(dtype)
184
@@ -209,7 +211,7 @@ def _literal(t, op):
209
211
sa.func.list_value(*value.keys()), sa.func.list_value(*value.values())
210
212
)
213
elif dtype.is_timestamp():
- return sa.cast(value.isoformat(), t.get_sqla_type(dtype))
214
+ return sa.cast(sa.literal(value.isoformat()), t.get_sqla_type(dtype))
215
elif dtype.is_date():
216
return sa.func.make_date(value.year, value.month, value.day)
217
elif dtype.is_time():
0 commit comments