You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/04/25 01:13:00 UTC
[GitHub] [spark] zhengruifeng commented on pull request #40927: [SPARK-42419][FOLLOWUP][CONNECT][PYTHON] Remove unused exception
zhengruifeng commented on PR #40927:
URL: https://github.com/apache/spark/pull/40927#issuecomment-1521023572
to be more consistent with https://github.com/apache/spark/blob/a45affe3c8e7a724aea7dbbc1af08e36001c7540/python/pyspark/sql/column.py#L924-L932
what about changing to?
```
if isinstance(length, Column):
length_expr = length._expr
start_expr = startPos._expr
elif isinstance(length, int):
length_expr = LiteralExpression._from_value(length)
start_expr = LiteralExpression._from_value(startPos)
else:
raise PySparkTypeError(
error_class="NOT_COLUMN_OR_INT",
message_parameters={"arg_name": "length", "arg_type": type(length).__name__},
)
```
--
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