fix: Remove manual type validation from SparkClient.connect()#294
fix: Remove manual type validation from SparkClient.connect()#294VHemanth45 wants to merge 1 commit intokubeflow:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🎉 Welcome to the Kubeflow SDK! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
Signed-off-by: Hemanth <vhemanthnaik45@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR removes redundant manual type validation from the KubernetesBackend._create_session() method. The isinstance() checks for resources_per_executor, spark_conf, num_executors, driver, and executor parameters are no longer necessary since:
- The method already has complete type annotations
- It's an internal method (prefix
_) only called from within the module - All callers in the call chain also have proper type hints
This cleanup aligns with the codebase philosophy of avoiding overly defensive code when type hints already provide the necessary documentation and validation expectations.
Changes:
- Removed 14 lines of manual isinstance() type validation from
_create_session()
|
Thanks for putting this together @VHemanth45! There was some earlier discussion about moving validation to the Spark Operator side (similar to SparkApplication/TrainJob) before removing it from the SDK - #225 (comment) Do we want to align on that first to avoid a validation gap? Tagging @andreyvelich and @ChenYi015 for guidance. |
|
Yes, we should add the webhook validation to the Spark Operator side as well. |
|
@andreyvelich: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Removes redundant manual type validation from KubernetesBackend._create_session()
Fixes #272