Skip to content

Commit 50b4328

Browse files
committed
Refactor filter method in DataFrame to directly use expression's expr attribute for improved clarity
1 parent 268f2fa commit 50b4328

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

python/datafusion/dataframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ def filter(self, *predicates: Expr) -> DataFrame:
424424
"""
425425
df = self.df
426426
for p in predicates:
427-
if isinstance(p, str) or not isinstance(p, Expr):
427+
if not isinstance(p, Expr):
428428
error = "Use col() or lit() to construct expressions"
429429
raise TypeError(error)
430-
df = df.filter(expr_list_to_raw_expr_list(p)[0])
430+
df = df.filter(p.expr)
431431
return DataFrame(df)
432432

433433
def with_column(self, name: str, expr: Expr) -> DataFrame:

0 commit comments

Comments
 (0)