Skip to content

Comments

[SPARK-41204] [CONNECT] Migrate custom exceptions to use Spark exceptions#38728

Closed
grundprinzip wants to merge 8 commits intoapache:masterfrom
grundprinzip:SPARK-41204
Closed

[SPARK-41204] [CONNECT] Migrate custom exceptions to use Spark exceptions#38728
grundprinzip wants to merge 8 commits intoapache:masterfrom
grundprinzip:SPARK-41204

Conversation

@grundprinzip
Copy link
Contributor

What changes were proposed in this pull request?

Migrate existing custom exceptions in Spark Connect to use the proper Spark exceptions.

Why are the changes needed?

Consistency

Does this PR introduce any user-facing change?

No

How was this patch tested?

existing UT

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

private val message: String = "",
private val cause: Throwable = None.orNull)
extends Exception(message, cause)
extends SparkException(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @MaxGekk @itholic HELP!!

@grundprinzip
Copy link
Contributor Author

@itholic Finally got around addressing your comments, please have another look. Thanks!

Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also cc @srielau

@grundprinzip
Copy link
Contributor Author

I will add tests for the missing cases.

Copy link
Contributor Author

@grundprinzip grundprinzip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the comments, added tests.

"Invalid Set operation: <type> does not support <param>."
]
},
"INVALID_PLAN_TRANSFORM_NA_FILL_EMPTY" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is NA?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the underlying operator.

 def fillna(
        self,
        value: Union["LiteralType", Dict[str, "LiteralType"]],
        subset: Optional[Union[str, Tuple[str, ...], List[str]]] = None,
    ) -> "DataFrame":
        """Replace null values, alias for ``na.fill()``.
        :func:`DataFrame.fillna` and :func:`DataFrameNaFunctions.fill` are aliases of each other.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm, I'm now no smarter. The real question is: Will users know what to do with this error?

@srielau
Copy link
Contributor

srielau commented Nov 29, 2022

General comment. You use CONNECT as error class, everything else is a sub error class. Many of these are INVALID_PLAN.
How many errors total do you expect?
Note that at present we support only two levels.
Would it make sense to use CONNECT (or an abbreviation of it) as a prefix and then perhaps subclass at INVALID_PLAN:
CONNECT_INVALID_PLAN.xxx

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Mar 11, 2023
@github-actions github-actions bot closed this Mar 12, 2023
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.

6 participants