HyukjinKwon commented on a change in pull request #28327:
URL: https://github.com/apache/spark/pull/28327#discussion_r415487078
##########
File path: python/pyspark/sql/tests/test_column.py
##########
@@ -87,24 +85,14 @@ def test_column_operators(self):
"Cannot apply 'in' operator against a column",
lambda: 1 in cs)
- def test_column_apply(self):
+ def test_column_accessor(self):
from pyspark.sql.functions import col
self.assertIsInstance(col("foo")[1:3], Column)
self.assertIsInstance(col("foo")[0], Column)
self.assertIsInstance(col("foo")["bar"], Column)
self.assertRaises(ValueError, lambda: col("foo")[0:10:2])
- def test_column_getitem(self):
- from pyspark.sql.functions import col, create_map, lit
-
- map_col = create_map(lit(0), lit(100), lit(1), lit(200))
- self.assertRaisesRegexp(
- Py4JJavaError,
- "Unsupported literal type class org.apache.spark.sql.Column id",
Review comment:
It can be a valid test case yes. But let's just go simple. We should
just target to print out a warning message against this specific case, which is
tricky to test out, and I manually tested it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]