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: [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