Skip to content

fix: Remove manual type validation from SparkClient.connect()#294

Closed
VHemanth45 wants to merge 1 commit intokubeflow:mainfrom
VHemanth45:nnew
Closed

fix: Remove manual type validation from SparkClient.connect()#294
VHemanth45 wants to merge 1 commit intokubeflow:mainfrom
VHemanth45:nnew

Conversation

@VHemanth45
Copy link

Removes redundant manual type validation from KubernetesBackend._create_session()
Fixes #272

Copilot AI review requested due to automatic review settings February 13, 2026 09:49
@google-oss-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kramaranya for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Contributor

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

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

@VHemanth45 VHemanth45 changed the title Remove manual type validation from SparkClient.connect() refactor: Remove manual type validation from SparkClient.connect()Remove manual type validation from SparkClient.connect() Feb 13, 2026
Signed-off-by: Hemanth <vhemanthnaik45@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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:

  1. The method already has complete type annotations
  2. It's an internal method (prefix _) only called from within the module
  3. 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()

@VHemanth45 VHemanth45 changed the title refactor: Remove manual type validation from SparkClient.connect()Remove manual type validation from SparkClient.connect() refactor: Remove manual type validation from SparkClient.connect() Feb 13, 2026
@VHemanth45 VHemanth45 changed the title refactor: Remove manual type validation from SparkClient.connect() fix: Remove manual type validation from SparkClient.connect() Feb 13, 2026
@tariq-hasan
Copy link
Contributor

tariq-hasan commented Feb 13, 2026

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.

@andreyvelich
Copy link
Member

Yes, we should add the webhook validation to the Spark Operator side as well.
I noticed that @tariq-hasan is assigned for this issue, so we can close this PR for now: #272
/close

@google-oss-prow google-oss-prow bot closed this Feb 13, 2026
@google-oss-prow
Copy link
Contributor

@andreyvelich: Closed this PR.

Details

In response to this:

Yes, we should add the webhook validation to the Spark Operator side as well.
I noticed that @tariq-hasan is assigned for this issue, so we can close this PR for now: #272
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(spark): Remove manual type validation from SparkClient.connect()

4 participants