Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/17469#discussion_r109574278
--- Diff: python/pyspark/sql/column.py ---
@@ -303,8 +333,25 @@ def isin(self, *cols):
desc = _unary_op("desc", "Returns a sort expression based on the"
" descending order of the given column name.")
- isNull = _unary_op("isNull", "True if the current expression is null.")
- isNotNull = _unary_op("isNotNull", "True if the current expression is
not null.")
+ _isNull_doc = ''' True if the current expression is null. Often
combined with
+ :func:`DataFrame.filter` to select rows with null
values.
+
+ >>> df2.collect()
+ [Row(name=u'Tom', height=80), Row(name=u'Alice',
height=None)]
+ >>> df2.filter( df2.height.isNull ).collect()
+ [Row(name=u'Alice', height=None)]
+ '''
+ _isNotNull_doc = ''' True if the current expression is null. Often
combined with
--- End diff --
Up to my knowledge, both docstrings comply pep8 up to my knowledge,
```
""" ...
"""
```
or
```
"""
...
"""
```
but for this case, it seems a separate variable. Personally, I prefer
```python
_isNull_doc = """
True if the current expression is null. Often combined with
:func:`DataFrame.filter` to select rows with null values.
>>> df2.collect()
[Row(name=u'Tom', height=80), Row(name=u'Alice', height=None)]
>>> df2.filter( df2.height.isNull ).collect()
[Row(name=u'Alice', height=None)]
"""
```
but I could not find a formal reference to support this idea (in case that
it is a separate variable) and I am not supposed to decide this. So, I am fine.
---
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]