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 380a2ac commit 73cfddfCopy full SHA for 73cfddf
python/datafusion/expr.py
@@ -374,6 +374,8 @@ def literal(value: Any) -> Expr:
374
375
``value`` must be a valid PyArrow scalar value or easily castable to one.
376
"""
377
+ if isinstance(value, str):
378
+ value = pa.scalar(value, type=pa.string_view())
379
if not isinstance(value, pa.Scalar):
380
value = pa.scalar(value)
381
return Expr(expr_internal.Expr.literal(value))
@@ -419,7 +421,7 @@ def fill_null(self, value: Any | Expr | None = None) -> Expr:
419
421
_to_pyarrow_types = {
420
422
float: pa.float64(),
423
int: pa.int64(),
- str: pa.string(),
424
+ str: pa.string_view(),
425
bool: pa.bool_(),
426
}
427
0 commit comments