uros-b commented on code in PR #56726:
URL: https://github.com/apache/spark/pull/56726#discussion_r3466627311
##########
python/pyspark/sql/connect/column.py:
##########
@@ -419,6 +419,10 @@ def alias(self, *alias: str, **kwargs: Any) ->
ParentColumn:
name = alias
+ @property
+ def _name(self) -> str:
+ return self._expr.__repr__()
Review Comment:
Note: undocumented Classic/Connect output divergence. The docstring's
cast("int") -> 'CAST(a AS INT)' happens to agree, but Spark's own
CastExpression.__repr__ (connect/expressions.py:1005-1008) documents
cast("long") -> CAST(a AS BIGINT) (Classic) vs CAST(a AS LONG) (Connect). _name
inherits this, so the PR's stated motivating use-case ("branch on the name
inside a helper function") is backend-dependent and unreliable.
--
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]