Skip to content

[SPARK-46642][PYTHON] Add getMessageTemplate to PySpark error framework#44658

Closed
itholic wants to merge 2 commits intoapache:masterfrom
itholic:SPARK-46642
Closed

[SPARK-46642][PYTHON] Add getMessageTemplate to PySpark error framework#44658
itholic wants to merge 2 commits intoapache:masterfrom
itholic:SPARK-46642

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Jan 10, 2024

What changes were proposed in this pull request?

This PR proposes to add getMessageTemplate to PySpark error framework.

Why are the changes needed?

To provide users with a more flexible error message management method.

Does this PR introduce any user-facing change?

New API getMessageTemplate is added:

try:
    spark.sql("""SELECT a""")
except AnalysisException as e:
    e.getMessageTemplate()
    // "A column, variable, or function parameter with name <objectName> cannot be resolved."

How was this patch tested?

Added UT.

Was this patch authored or co-authored using generative AI tooling?

No.

@itholic itholic closed this Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments