Github user nchammas commented on a diff in the pull request:
https://github.com/apache/spark/pull/18926#discussion_r133029498
--- Diff: python/pyspark/sql/column.py ---
@@ -406,8 +406,14 @@ def substr(self, startPos, length):
[Row(col=u'Ali'), Row(col=u'Bob')]
"""
if type(startPos) != type(length):
- raise TypeError("Can not mix the type")
- if isinstance(startPos, (int, long)):
+ raise TypeError(
+ "startPos and length must be the same type. "
+ "Got {startPos_t} and {length_t}, respectively."
+ .format(
+ startPos_t=type(startPos),
+ length_t=type(length),
+ ))
+ if isinstance(startPos, int):
--- End diff --
Since `long` is [not
supported](https://github.com/apache/spark/pull/18926#discussion_r132837359), I
just removed it from here.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]