spark_submit_hook: resolve connection master URL construction#61528
Merged
eladkal merged 1 commit intoapache:mainfrom Feb 25, 2026
Merged
spark_submit_hook: resolve connection master URL construction#61528eladkal merged 1 commit intoapache:mainfrom
eladkal merged 1 commit intoapache:mainfrom
Conversation
Nataneljpwd
reviewed
Feb 6, 2026
Contributor
Nataneljpwd
left a comment
There was a problem hiding this comment.
Looks good, a few comments need to be addressed first
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Outdated
Show resolved
Hide resolved
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Outdated
Show resolved
Hide resolved
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Outdated
Show resolved
Hide resolved
Nataneljpwd
reviewed
Feb 6, 2026
providers/apache/spark/tests/unit/apache/spark/hooks/test_spark_submit.py
Show resolved
Hide resolved
1427565 to
f2a6469
Compare
Nataneljpwd
reviewed
Feb 8, 2026
Contributor
Nataneljpwd
left a comment
There was a problem hiding this comment.
Looks great!
1 comment left to resolve and I will approve
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Outdated
Show resolved
Hide resolved
providers/apache/spark/tests/unit/apache/spark/hooks/test_spark_submit.py
Show resolved
Hide resolved
f2a6469 to
79f86da
Compare
Nataneljpwd
approved these changes
Feb 8, 2026
Contributor
Nataneljpwd
left a comment
There was a problem hiding this comment.
Looks great!
Great job!
816f979 to
e31e33c
Compare
Contributor
Author
Thanks, I just fixed it, could you please review it again? |
Nataneljpwd
reviewed
Feb 8, 2026
Contributor
Nataneljpwd
left a comment
There was a problem hiding this comment.
1 small change is left
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Show resolved
Hide resolved
Contributor
Author
|
@potiuk Could you please review this PR? |
potiuk
reviewed
Feb 15, 2026
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Show resolved
Hide resolved
e31e33c to
266d24f
Compare
Nataneljpwd
reviewed
Feb 17, 2026
…ious protocols Signed-off-by: Hossein Torabi <sayed.torabi@ing.com>
266d24f to
93e3484
Compare
Nataneljpwd
approved these changes
Feb 22, 2026
nevcohen
reviewed
Feb 24, 2026
Contributor
nevcohen
left a comment
There was a problem hiding this comment.
Just one thing I didn't fully understand, overall good job.
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py
Show resolved
Hide resolved
eladkal
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spark_submit_hook: resolve connection master URL construction
Root Cause
When a Spark connection is created from a URI (e.g.,
spark://spark-master:7077), the_parse_from_urimethod inconnection.pyextracts the scheme (spark://) and stores it asconn_type, whileconn.hostonly contains the hostname (spark-master).However,
_resolve_connectioninSparkSubmitHookassumed all connections were created via UI whereconn_typeis alwayssparkandconn.hostcontains the full master URL with protocol (e.g.,spark://host,k8s://https://host).Impact
When using environment variables or URI format, the master URL was missing its protocol prefix:
spark://spark-master:7077spark-master:7077spark://spark-master:7077k8s://https://k8s-host:443https://k8s-host:443k8s://https://k8s-host:443Fix
Updated
_resolve_connectionto properly handle connections created from URI by usingconn_typeto reconstruct the protocol prefix whenconn.hostdoesn't already contain://.closes: #56453