Skip to content

Commit d7a466d

Browse files
committed
Refactor DataFrame filter method to improve type checking for predicates
1 parent b7daf4c commit d7a466d

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
@@ -430,9 +430,9 @@ def filter(self, *predicates: Expr) -> DataFrame:
430430
"""
431431
df = self.df
432432
for p in predicates:
433-
if isinstance(p, str) or not isinstance(p, Expr):
433+
if not isinstance(p, Expr):
434434
raise TypeError(_EXPR_TYPE_ERROR)
435-
df = df.filter(expr_list_to_raw_expr_list(p)[0])
435+
df = df.filter(p.expr)
436436
return DataFrame(df)
437437

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

0 commit comments

Comments
 (0)