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/08/20 07:57:09 UTC

[GitHub] [spark] dcoliversun opened a new pull request, #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   As mentioned https://github.com/apache/spark/pull/37482#issuecomment-1212245579,  this PR proposes to add document parameters for `pyspark.sql.streaming.query`.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   To make the documentation more readable.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   Yes, it changes the documentation.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   Manually ran each doctest.


-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37587:
URL: https://github.com/apache/spark/pull/37587#issuecomment-1223375394

   Thanks for working on this @dcoliversun 


-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37587:
URL: https://github.com/apache/spark/pull/37587#issuecomment-1221436109

   cc @HeartSaVioR if you find some time to take a look


-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37587:
URL: https://github.com/apache/spark/pull/37587#issuecomment-1223375250

   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 pull request #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37587:
URL: https://github.com/apache/spark/pull/37587#issuecomment-1221733375

   Looks pretty good otherwise.


-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #37587:
URL: https://github.com/apache/spark/pull/37587#issuecomment-1221267996

   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


[GitHub] [spark] dcoliversun commented on pull request #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
dcoliversun commented on PR #37587:
URL: https://github.com/apache/spark/pull/37587#issuecomment-1221253694

   cc @HyukjinKwon @xinrong-meng 
   It would be good if you could take a look when you have time, thanks!


-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950967573


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -382,10 +431,24 @@ def active(self) -> List[StreamingQuery]:
     def get(self, id: str) -> StreamingQuery:
         """
         Returns an active query from this SparkSession or throws exception if an active query
-        with this name doesn't exist.
+        with this id doesn't exist.
 
         .. versionadded:: 2.0.0
 
+        Parameters
+        ----------
+        id : str
+            The unique id of specified query.
+
+        Returns
+        -------
+        :class:`StreamingQuery`
+            An active query with `id` from this SparkSession.
+
+        Notes
+        -----
+        Exception will be thrown if an active query with this id doesn't exist.

Review Comment:
   doesn't -> does not



##########
python/pyspark/sql/streaming/query.py:
##########
@@ -382,10 +431,24 @@ def active(self) -> List[StreamingQuery]:
     def get(self, id: str) -> StreamingQuery:
         """
         Returns an active query from this SparkSession or throws exception if an active query
-        with this name doesn't exist.
+        with this id doesn't exist.

Review Comment:
   doesn't -> does not



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950965805


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -167,6 +199,11 @@ def status(self) -> Dict[str, Any]:
         """
         Returns the current status of the query.
 
+        Returns
+        -------
+        str or dict

Review Comment:
   I think it always returns a dictionary?



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950966355


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -189,6 +226,11 @@ def recentProgress(self) -> List[Dict[str, Any]]:
         The number of progress updates retained for each stream is configured by Spark session
         configuration `spark.sql.streaming.numRecentProgressUpdates`.
 
+        Returns
+        -------
+        str or dict or list

Review Comment:
   ditto. I think it's always a list of dictionaries.



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r952039078


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -381,11 +431,24 @@ def active(self) -> List[StreamingQuery]:
 
     def get(self, id: str) -> StreamingQuery:
         """
-        Returns an active query from this SparkSession or throws exception if an active query
-        with this name doesn't exist.
+        Returns an active query from this SparkSession.

Review Comment:
   ```suggestion
           Returns an active query from this :class:`SparkSession`.
   ```



##########
python/pyspark/sql/streaming/query.py:
##########
@@ -360,6 +405,11 @@ def active(self) -> List[StreamingQuery]:
 
         .. versionadded:: 2.0.0
 
+        Returns
+        -------
+        list
+            The active queries associated with this SparkSession.

Review Comment:
   ```suggestion
               The active queries associated with this :class:`SparkSession`.
   ```



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query
URL: https://github.com/apache/spark/pull/37587


-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950967915


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -382,10 +431,24 @@ def active(self) -> List[StreamingQuery]:
     def get(self, id: str) -> StreamingQuery:
         """
         Returns an active query from this SparkSession or throws exception if an active query
-        with this name doesn't exist.
+        with this id doesn't exist.

Review Comment:
   We can actually remove this I think because we're noting it in `Notes`.



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950967306


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -360,6 +404,11 @@ def active(self) -> List[StreamingQuery]:
 
         .. versionadded:: 2.0.0
 
+        Returns
+        -------
+        :class:`StreamingQuery` or list

Review Comment:
   list



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950967121


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -213,7 +255,9 @@ def lastProgress(self) -> Optional[Dict[str, Any]]:
 
         Returns
         -------
-        dict
+        str or dict or optional

Review Comment:
   dict, optional



-- 
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 #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950966866


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -189,6 +226,11 @@ def recentProgress(self) -> List[Dict[str, Any]]:
         The number of progress updates retained for each stream is configured by Spark session
         configuration `spark.sql.streaming.numRecentProgressUpdates`.
 
+        Returns
+        -------
+        str or dict or list
+            An array of the most recent :class:`StreamingQueryProgress` updates for this query.

Review Comment:
   Should probably mention that return a dictionary instead of `StreamingQueryProgress` instance.



-- 
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] dcoliversun commented on a diff in pull request #37587: [SPARK-40081][PYTHON][DOCS] Add document parameters for pyspark.sql.streaming.query

Posted by GitBox <gi...@apache.org>.
dcoliversun commented on code in PR #37587:
URL: https://github.com/apache/spark/pull/37587#discussion_r950987447


##########
python/pyspark/sql/streaming/query.py:
##########
@@ -189,6 +226,11 @@ def recentProgress(self) -> List[Dict[str, Any]]:
         The number of progress updates retained for each stream is configured by Spark session
         configuration `spark.sql.streaming.numRecentProgressUpdates`.
 
+        Returns
+        -------
+        str or dict or list
+            An array of the most recent :class:`StreamingQueryProgress` updates for this query.

Review Comment:
   I choose to keep `StreamingQueryProgress` and add `dict` here. Because `StreamingQueryProgress` can help user to understand how it is in `dictionary`.



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