Skip to content

Commit 1c5b91e

Browse files
committed
docs: implement ruff recommendation
1 parent 74cbd3b commit 1c5b91e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

python/datafusion/expr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,11 @@ def literal(value: Any) -> Expr:
384384
def utf8_literal(value: str) -> Expr:
385385
"""Creates a new expression representing a UTF8 literal value.
386386
387-
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
387+
It is different from `literal` because it is pa.string() instead of
388+
pa.string_view()
389+
390+
This is needed for cases where DataFusion is expecting a UTF8 instead of
391+
UTF8View literal, like in:
389392
https://github.com/apache/datafusion/blob/86740bfd3d9831d6b7c1d0e1bf4a21d91598a0ac/datafusion/functions/src/core/arrow_cast.rs#L179
390393
"""
391394
if isinstance(value, str):

python/tests/test_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,8 @@ def test_temporal_functions(df):
911911

912912
def test_arrow_cast(df):
913913
df = df.select(
914-
# we use `utf8_literal` to returns utf8 instead of `literal` which returns utf8view
915-
# because datafusion.arrow_cast # expects a utf8 instead of utf8view
914+
# we use `utf8_literal` to returns utf8 instead of `literal` which returns
915+
# utf8view # because datafusion.arrow_cast expects a utf8 instead of utf8view
916916
# https://github.com/apache/datafusion/blob/86740bfd3d9831d6b7c1d0e1bf4a21d91598a0ac/datafusion/functions/src/core/arrow_cast.rs#L179
917917
f.arrow_cast(column("b"), utf8_literal("Float64")).alias("b_as_float"),
918918
f.arrow_cast(column("b"), utf8_literal("Int32")).alias("b_as_int"),

0 commit comments

Comments
 (0)