ntjohnson1 commented on code in PR #1484:
URL: 
https://github.com/apache/datafusion-python/pull/1484#discussion_r3106803489


##########
python/datafusion/functions.py:
##########
@@ -1461,19 +1478,24 @@ def regexp_like(string: Expr, regex: Expr, flags: Expr 
| None = None) -> Expr:
 
         >>> result = df.select(
         ...     dfn.functions.regexp_like(
-        ...         dfn.col("a"), dfn.lit("HELLO"),
-        ...         flags=dfn.lit("i"),
+        ...         dfn.col("a"), "HELLO", flags="i",
         ...     ).alias("m")
         ... )
         >>> result.collect_column("m")[0].as_py()
         True
     """
-    if flags is not None:
-        flags = flags.expr
-    return Expr(f.regexp_like(string.expr, regex.expr, flags))
+    regex = coerce_to_expr(regex)
+    flags = coerce_to_expr_or_none(flags)

Review Comment:
   It's only used 12 times but every usage in this file feels like it would 
prefer `coerce_to_internal_expr_or_none` so it doesn't have to do the coversion 
to internal or none



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to