Skip to content

Commit 3e50d86

Browse files
timsaucerclaude
andcommitted
fix: update alias function signatures to match pythonic primary functions
Update instr and position (aliases of strpos) to accept Expr | str for the substring parameter, matching the updated primary function signature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b9d956a commit 3e50d86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/datafusion/functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ def initcap(string: Expr) -> Expr:
10961096
return Expr(f.initcap(string.expr))
10971097

10981098

1099-
def instr(string: Expr, substring: Expr) -> Expr:
1099+
def instr(string: Expr, substring: Expr | str) -> Expr:
11001100
"""Finds the position from where the ``substring`` matches the ``string``.
11011101
11021102
See Also:
@@ -1422,7 +1422,7 @@ def pi() -> Expr:
14221422
return Expr(f.pi())
14231423

14241424

1425-
def position(string: Expr, substring: Expr) -> Expr:
1425+
def position(string: Expr, substring: Expr | str) -> Expr:
14261426
"""Finds the position from where the ``substring`` matches the ``string``.
14271427
14281428
See Also:

0 commit comments

Comments
 (0)