You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/03 18:52:38 UTC
[GitHub] [spark] khalidmammadov opened a new pull request, #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
khalidmammadov opened a new pull request, #37786:
URL: https://github.com/apache/spark/pull/37786
### What changes were proposed in this pull request?
It's part of the Pyspark docstrings improvement series (https://github.com/apache/spark/pull/37592, https://github.com/apache/spark/pull/37662, https://github.com/apache/spark/pull/37686)
In this PR I mainly covered missing parts in the docstrings adding some more examples where it needed.
### Why are the changes needed?
To improve PySpark documentation
### Does this PR introduce _any_ user-facing change?
Yes, documentation
### How was this patch tested?
PYTHON_EXECUTABLE=python3.9 ./dev/lint-python
./python/run-tests --testnames pyspark.sql.functions
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] itholic commented on a diff in pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #37786:
URL: https://github.com/apache/spark/pull/37786#discussion_r962518751
##########
python/pyspark/sql/functions.py:
##########
@@ -3925,10 +3987,20 @@ def dayofmonth(col: "ColumnOrName") -> Column:
def dayofyear(col: "ColumnOrName") -> Column:
"""
- Extract the day of the year of a given date as integer.
+ Extract the day of the year of a given date/timestamp as integer.
.. versionadded:: 1.5.0
+ Parameters
+ ----------
+ col : :class:`~pyspark.sql.Column` or str
+ target date/timestamp column to work on.
+
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ day of the year for given date/timestamp as integer.
Review Comment:
Very nit, and don't much have strong feeling about this,
Maybe:
```
`day` of the year for given...
```
since we describe
```
`week` of the year for given...
```
in the `weekofyear` function.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37786:
URL: https://github.com/apache/spark/pull/37786#issuecomment-1236516486
Merged to master.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37786:
URL: https://github.com/apache/spark/pull/37786#discussion_r962581628
##########
python/pyspark/sql/functions.py:
##########
@@ -3925,10 +3987,20 @@ def dayofmonth(col: "ColumnOrName") -> Column:
def dayofyear(col: "ColumnOrName") -> Column:
"""
- Extract the day of the year of a given date as integer.
+ Extract the day of the year of a given date/timestamp as integer.
.. versionadded:: 1.5.0
+ Parameters
+ ----------
+ col : :class:`~pyspark.sql.Column` or str
+ target date/timestamp column to work on.
+
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ day of the year for given date/timestamp as integer.
Review Comment:
feel free to create a followup @itholic
##########
python/pyspark/sql/functions.py:
##########
@@ -3925,10 +3987,20 @@ def dayofmonth(col: "ColumnOrName") -> Column:
def dayofyear(col: "ColumnOrName") -> Column:
"""
- Extract the day of the year of a given date as integer.
+ Extract the day of the year of a given date/timestamp as integer.
.. versionadded:: 1.5.0
+ Parameters
+ ----------
+ col : :class:`~pyspark.sql.Column` or str
+ target date/timestamp column to work on.
+
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ day of the year for given date/timestamp as integer.
Review Comment:
would be great to fix other typos or nits together if you find some more
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] itholic commented on a diff in pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #37786:
URL: https://github.com/apache/spark/pull/37786#discussion_r962519468
##########
python/pyspark/sql/functions.py:
##########
@@ -3925,10 +3987,20 @@ def dayofmonth(col: "ColumnOrName") -> Column:
def dayofyear(col: "ColumnOrName") -> Column:
"""
- Extract the day of the year of a given date as integer.
+ Extract the day of the year of a given date/timestamp as integer.
.. versionadded:: 1.5.0
+ Parameters
+ ----------
+ col : :class:`~pyspark.sql.Column` or str
+ target date/timestamp column to work on.
+
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ day of the year for given date/timestamp as integer.
Review Comment:
But let's keep it as is for now.
Thanks for working on this!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] khalidmammadov commented on pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on PR #37786:
URL: https://github.com/apache/spark/pull/37786#issuecomment-1236280922
@HyukjinKwon @srowen @itholic please review
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] itholic commented on a diff in pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #37786:
URL: https://github.com/apache/spark/pull/37786#discussion_r963155761
##########
python/pyspark/sql/functions.py:
##########
@@ -3925,10 +3987,20 @@ def dayofmonth(col: "ColumnOrName") -> Column:
def dayofyear(col: "ColumnOrName") -> Column:
"""
- Extract the day of the year of a given date as integer.
+ Extract the day of the year of a given date/timestamp as integer.
.. versionadded:: 1.5.0
+ Parameters
+ ----------
+ col : :class:`~pyspark.sql.Column` or str
+ target date/timestamp column to work on.
+
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ day of the year for given date/timestamp as integer.
Review Comment:
Sure, let me find some more improvements and will open a followup.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon closed pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
URL: https://github.com/apache/spark/pull/37786
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #37786: [SPARK-40142][PYTHON][SQL][FOLLOW-UP] Make pyspark.sql.functions examples self-contained (part 5, ~28 functions)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #37786:
URL: https://github.com/apache/spark/pull/37786#issuecomment-1236215711
Can one of the admins verify this patch?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org