Skip to content

Commit 28a3e65

Browse files
committed
fix: update ensure_expr to reject non-Expr values for consistency
1 parent 8bdce97 commit 28a3e65

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

python/datafusion/expr.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@
222222
]
223223

224224

225-
def ensure_expr(value: Expr) -> expr_internal.Expr:
225+
def ensure_expr(value: Expr | Any) -> expr_internal.Expr:
226226
"""Return the internal expression from ``Expr`` or raise ``TypeError``.
227227
228-
This helper rejects plain strings so higher level APIs consistently
229-
require explicit :func:`~datafusion.col` or :func:`~datafusion.lit`
230-
expressions.
228+
This helper rejects plain strings and other non-:class:`Expr` values so
229+
higher level APIs consistently require explicit :func:`~datafusion.col` or
230+
:func:`~datafusion.lit` expressions.
231231
232232
Args:
233-
value: Candidate expression.
233+
value: Candidate expression or other object.
234234
235235
Returns:
236236
The internal expression representation.

0 commit comments

Comments
 (0)