fix(spark): drop the stray argument passed to _backend_config in the advanced-options example - #786
Conversation
`_backend_config()` takes no parameters, but example 5
(`example_combined_options`) calls it as
`_backend_config("spark-production")`, which raises
TypeError: _backend_config() takes 0 positional arguments but 1 was given
The other four call sites in this file all invoke it with no arguments.
Because `main()` wraps every example in a broad `except Exception`, the
failure surfaces as a misleading "make sure you have Spark Operator
installed / RBAC configured" message and example 5 never runs.
The namespace has to stay environment-driven so the in-cluster E2E run
keeps using `SPARK_TEST_NAMESPACE`, and this example already names its
session through the `Name(_e2e_session_name("prod-etl-session"))` option,
so the extra argument is simply dropped to match the sibling call sites.
Signed-off-by: Tai An <antai12232931@outlook.com>
|
🎉 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! |
|
[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 |
|
/ok-to-test |
|
Thanks! |
Problem
examples/spark/spark_advanced_options.pydefines the helper with no parameters:Four of the five call sites invoke it correctly, but example 5 passes an argument:
_backend_config()_backend_config()_backend_config()_backend_config()_backend_config("spark-production")Line 217 raises:
main()wraps every example in a broadexcept Exception, so the user neversees the
TypeErroritself — example 5 silently never runs and the scriptprints the misleading advice instead:
ALL EXAMPLES COMPLETE!is never printed. The in-cluster E2E run is unaffectedbecause
SPARK_E2E_RUN_IN_CLUSTER=1skips example 5, which is why this has goneunnoticed in CI.
Fix
Drop the stray argument so line 217 matches the other four call sites.
I deliberately did not make
_backend_configaccept a namespace: thenamespace must stay environment-driven (
SPARK_TEST_NAMESPACE) for thein-cluster E2E run, and this example already names its session through the
options pattern it is demonstrating:
Verification
Signature replay against
main(3febcd7):After the patch, no call site passes an argument. Diff is one line.
🤖 Generated with Claude Code