spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From map222 <...@git.apache.org>
Subject [GitHub] spark pull request #17469: [SPARK-20132][Docs] Add documentation for column ...
Date Thu, 30 Mar 2017 20:59:54 GMT
Github user map222 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17469#discussion_r109036171
  
    --- Diff: python/pyspark/sql/column.py ---
    @@ -124,6 +124,35 @@ def _(self, other):
         return _
     
     
    +like_doc = """ Return a Boolean :class:`Column` based on a SQL LIKE match.\n
    +               :param other: a SQL LIKE pattern\n
    +               See :func:`pyspark.sql.Column.rlike` for a regex version\n
    +
    +               >>> df.filter( df.name.like('Al%') ).collect()
    +               [Row(name=u'Alice', age=1)]
    +            """
    +rlike_doc = """ Return a Boolean :class:`Column` based on a regex match.\n
    +                :param other: an extended regex expression\n
    +
    +                >>> df.filter( df.name.rlike('ice$') ).collect()
    +                [Row(name=u'Alice', age=1)]
    +            """
    +endswith_doc = ''' Return a Boolean :class:`Column` based on matching end of string.\n
    +                   :param other: string at end of line (do not use a regex `$`)\n
    +                   >>> df.filter(df.name.endswith('ice')).collect()
    +                   [Row(name=u'Alice', age=1)]
    +                   >>> df.filter(df.name.endswith('ice$')).collect()
    +                   []
    +               '''
    +startswith_doc = ''' Return a Boolean :class:`Column` based on a string match.\n
    --- End diff --
    
    Ah, thank you! I couldn't figure out how to get the docs from not showing up as separate
functions, but this solved it. I added `_` to the front of the docstrings, and moved them
into the `Column` class, immediately before the `_bin_op` definitions.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message