8000 docs: clarify utf8_literal function documentation to explain use case · kosiew/datafusion-python@0106cb7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0106cb7

Browse files
committed
docs: clarify utf8_literal function documentation to explain use case
1 parent d801567 commit 0106cb7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/datafusion/expr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ def utf8_literal(value: str) -> Expr:
385385
"""Creates a new expression representing a UTF8 literal value.
386386
387387
It is different from `literal` because it is pa.string() instead of pa.string_view()
388+
This is needed for cases where datafusion is expecting a utf8 instead of utf8view literal like in
389+
https://github.com/apache/datafusion/blob/86740bfd3d9831d6b7c1d0e1bf4a21d91598a0ac/datafusion/functions/src/core/arrow_cast.rs#L179
388390
"""
389391
if isinstance(value, str):
390392
value = pa.scalar(value, type=pa.string())

0 commit comments

Comments
 (0)
0