You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/10 00:32:38 UTC
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #38994: [SPARK-41329][CONNECT] Resolve circular imports in Spark Connect
HyukjinKwon commented on code in PR #38994:
URL: https://github.com/apache/spark/pull/38994#discussion_r1044928308
##########
python/pyspark/sql/connect/column.py:
##########
@@ -706,28 +705,30 @@ def substr(self, startPos: Union[int, "Column"], length: Union[int, "Column"]) -
length_t=type(length),
)
)
- from pyspark.sql.connect.function_builder import functions as F
if isinstance(length, int):
- length_exp = self._lit(length)
+ length_exp = lit(length)
elif isinstance(length, Column):
length_exp = length
else:
raise TypeError("Unsupported type for substr().")
if isinstance(startPos, int):
- start_exp = self._lit(startPos)
+ start_exp = lit(startPos)
else:
start_exp = startPos
- return F.substr(self, start_exp, length_exp)
+ return F.substr(self, start_exp, length_exp) # type: ignore[attr-defined]
Review Comment:
```suggestion
return F.substr(self, start_exp, length_exp)
```
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org