HyukjinKwon commented on code in PR #41396:
URL: https://github.com/apache/spark/pull/41396#discussion_r1211177500
##########
python/pyspark/sql/dataframe.py:
##########
@@ -4868,6 +4868,22 @@ def freqItems(
self._jdf.stat().freqItems(_to_seq(self._sc, cols), support),
self.sparkSession
)
+ def _ipython_key_completions_(self) -> List[str]:
+ """Returns the names of columns in this :class:`DataFrame`.
+
+ Examples
+ --------
+ >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], ["age",
"name"])
+ >>> df._ipython_key_completions_()
+ ['age', 'name']
+
+ Would return illegal identifiers.
+ >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], ["age 1",
"name?1"])
+ >>> df._ipython_key_completions_()
+ ['age 1', 'name?1']
+ """
+ return self.columns
Review Comment:
shouldn't it call `__dir__`?
--
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]