Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/17737#discussion_r114049248
--- Diff: python/pyspark/sql/column.py ---
@@ -185,17 +185,51 @@ def __contains__(self, item):
"in a string column or 'array_contains' function
for an array column.")
# bitwise operators
- bitwiseOR = _bin_op("bitwiseOR")
- bitwiseAND = _bin_op("bitwiseAND")
- bitwiseXOR = _bin_op("bitwiseXOR")
+ _bitwiseOR_doc = """
+ Compute bitwise OR of this expression with another expression.
+
+ :param other: a value or :class:`Column` to calculate bitwise or(|)
against
+ this :class:`Column`.
+
+ >>> from pyspark.sql import Row
+ >>> df3 = spark.createDataFrame([Row(a=170, b=75)])
--- End diff --
I think there is a global `df` variable when running doctests and I guess
it was avoided to shadow the same name from the outer scope in some doctests
whereas other doctests just use it. I get your point. In documentation, we will
only see only the code block and I guess using `df` might be slightly better.
AFAIK, usually, Python documentation have self-contained doctests so I
don't know which case is better and correct. If you could confirm this, I can
sweep it.
---
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]