You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/11/21 06:27:05 UTC

[PR] [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module [spark]

HyukjinKwon opened a new pull request, #43925:
URL: https://github.com/apache/spark/pull/43925

   ### What changes were proposed in this pull request?
   
   This PR proposes to annotate parameters at docstrings in `pyspark.sql` module, especially about `Optional[...]`.
   
   ### Why are the changes needed?
   
   For correct documentation to the end users.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes it fixes the user-facing documentation.
   
   ### How was this patch tested?
   
   Existing linter checks should be sufficient.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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


Re: [PR] [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #43925:
URL: https://github.com/apache/spark/pull/43925#discussion_r1400210509


##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -17218,12 +17218,13 @@ def udf(
 
     Parameters
     ----------
-    f : function
+    f : function, optional
         python function if used as a standalone function
-    returnType : :class:`pyspark.sql.types.DataType` or str
+    returnType : :class:`pyspark.sql.types.DataType` or str, optional
         the return type of the user-defined function. The value can be either a
         :class:`pyspark.sql.types.DataType` object or a DDL-formatted type string.
-    useArrow : bool or None
+        Defaults to :class:`StringType.

Review Comment:
   ```suggestion
           Defaults to :class:`StringType`.
   ```



-- 
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


Re: [PR] [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #43925: [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module
URL: https://github.com/apache/spark/pull/43925


-- 
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


Re: [PR] [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #43925:
URL: https://github.com/apache/spark/pull/43925#discussion_r1400210509


##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -17218,12 +17218,13 @@ def udf(
 
     Parameters
     ----------
-    f : function
+    f : function, optional
         python function if used as a standalone function
-    returnType : :class:`pyspark.sql.types.DataType` or str
+    returnType : :class:`pyspark.sql.types.DataType` or str, optional
         the return type of the user-defined function. The value can be either a
         :class:`pyspark.sql.types.DataType` object or a DDL-formatted type string.
-    useArrow : bool or None
+        Defaults to :class:`StringType.

Review Comment:
   ```suggestion
           Defaults to :class:`StringType`.
   ```



-- 
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


Re: [PR] [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #43925:
URL: https://github.com/apache/spark/pull/43925#discussion_r1400081047


##########
python/pyspark/sql/catalog.py:
##########
@@ -126,7 +126,7 @@ def listCatalogs(self, pattern: Optional[str] = None) -> List[CatalogMetadata]:
 
         Parameters
         ----------
-        pattern : str
+        pattern : str, optional

Review Comment:
   This complies https://numpydoc.readthedocs.io/en/latest/format.html



-- 
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


Re: [PR] [SPARK-46023][PYTHON][DOCS] Annotate parameters at docstrings in pyspark.sql module [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #43925:
URL: https://github.com/apache/spark/pull/43925#issuecomment-1820722211

   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