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

[PR] [SPARK-47155] Fix Error Class Issue [spark]

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

   <!--
   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
        'common/utils/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   Make create_data_source.py use correct error class.
   
   ### Why are the changes needed?
   This is part of the effort of SPARK-44076 that enable python user to develop data source in python and make python accessible to wider python community. Error class "PYTHON_DATA_SOURCE_CREATE_ERROR" and "PYTHON_DATA_SOURCE_METHOD_NOT_IMPLEMENTED" used in create_data_source.py doesn't exist and will throw error class not found error.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
    Existing test 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-47155][PYTHON] Fix Error Class Issue [spark]

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


##########
python/pyspark/sql/worker/create_data_source.py:
##########
@@ -150,8 +150,8 @@ def main(infile: IO, outfile: IO) -> None:
                     is_ddl_string = True
             except NotImplementedError:
                 raise PySparkRuntimeError(
-                    error_class="PYTHON_DATA_SOURCE_METHOD_NOT_IMPLEMENTED",
-                    message_parameters={"type": "instance", "method": "schema"},
+                    error_class="NOT_IMPLEMENTED",
+                    message_parameters={"feature": "Reader.schema"},

Review Comment:
   ```suggestion
                       message_parameters={"feature": "DataSource.schema"},
   ```



-- 
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-47155] Fix Error Class Issue [spark]

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

   Good catch! Thanks for working on that. Would you add `[PYTHON]` to PR title?


-- 
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-47155][PYTHON] Fix Error Class Issue [spark]

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

   see https://github.com/sunan135/spark/actions/runs/8100089923


-- 
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-47155][PYTHON] Fix Error Class Issue [spark]

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

   ```
   ======================================================================
   FAIL [0.001s]: test_error_classes_sorted (pyspark.errors.tests.test_errors.ErrorsTest)
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File "/__w/spark/spark/python/pyspark/errors/tests/test_errors.py", line 33, in test_error_classes_sorted
       self.assertTrue(
   AssertionError: False is not true : Error class [DATA_SOURCE_RETURN_SCHEMA_MISMATCH] should place after [DATA_SOURCE_CREATE_ERROR].
   
   Run 'cd $SPARK_HOME; bin/pyspark' and 'from pyspark.errors.exceptions import _write_self; _write_self()' to automatically sort them.
   ```


-- 
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-47155][PYTHON] Fix Error Class Issue [spark]

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

   I think the actions should be enabled at https://github.com/sunan135/spark/settings/actions by `Allow all actions and reusable workflows`


-- 
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-47155][PYTHON] Fix Error Class Issue [spark]

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

   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


Re: [PR] [SPARK-47155][PYTHON] Fix Error Class Issue [spark]

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


##########
python/pyspark/sql/worker/create_data_source.py:
##########
@@ -150,8 +150,8 @@ def main(infile: IO, outfile: IO) -> None:
                     is_ddl_string = True
             except NotImplementedError:
                 raise PySparkRuntimeError(
-                    error_class="PYTHON_DATA_SOURCE_METHOD_NOT_IMPLEMENTED",
-                    message_parameters={"type": "instance", "method": "schema"},
+                    error_class="NOT_IMPLEMENTED",
+                    message_parameters={"feature": "Reader.schema"},

Review Comment:
   ```suggestion
                       message_parameters={"feature": "DataSource.schema"},
   ```



-- 
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-47155][PYTHON] Fix Error Class Issue [spark]

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

   What may be the issue here? The workflow failure is weird. @HyukjinKwon 
   `SHA: 31dfc375e56020b7c5d4b00ff0ed1c4aebd8ef2b
   Error: Failed to retrieve check_run_head after 3 attempts
       at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16), <anonymous>:92:11)
       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
       at async main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:20)
   Error: Unhandled error: Error: Failed to retrieve check_run_head after 3 attempts`


-- 
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-47155][PYTHON] Fix Error Class Issue [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #45306: [SPARK-47155][PYTHON] Fix Error Class Issue
URL: https://github.com/apache/spark/pull/45306


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