uros-b commented on code in PR #56726:
URL: https://github.com/apache/spark/pull/56726#discussion_r3466639712


##########
python/pyspark/sql/tests/test_column.py:
##########
@@ -290,6 +290,15 @@ def test_alias_negative(self):
             messageParameters={"arg_name": "metadata"},
         )
 
+    def test_name_property(self):
+        # SPARK-38483: Column._name exposes the column name/alias shown in repr
+        self.assertEqual(sf.col("a")._name, "a")
+        self.assertEqual(sf.col("a").cast("int")._name, "CAST(a AS INT)")

Review Comment:
   The new test has one concrete assert (CAST(a AS INT)) plus a tautological 
invariant loop (repr(col) == "Column<'%s'>" % col._name); please consider 
adding a concrete expected string for alias/arithmetic (e.g. 
col("x").alias("y")._name == "x AS y").



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