Skip to content

fix(spark): allow directory paths in submit_deps - #6368

Merged
rsareddy0329 merged 1 commit into
aws:master-v2from
rsareddy0329:fix/spark-submit-deps-dir-v2
Oct 5, 2026
Merged

rsareddy0329 merged 1 commit into
aws:master-v2from
rsareddy0329:fix/spark-submit-deps-dir-v2

Conversation

@rsareddy0329

Copy link
Copy Markdown
Contributor

Issue #, if available: Relates to #2447

Description of changes:

PySparkProcessor / SparkJarProcessor rejected a local directory passed via
submit_py_files / submit_jars / submit_files. _stage_submit_deps required
os.path.isfile(dep_path) and raised submit_deps path ... is not a valid local file
for a directory, so users could only enumerate individual files.

This accepts a directory as well: its tree is copied into the staging temp dir (via
shutil.copytree) so its contents are uploaded to the dependency input channel and
mounted into the Spark container, alongside the existing single-file handling. The
error message now mentions directories.

Testing:

  • New unit test test_stage_submit_deps_accepts_directory — a local directory is
    staged (input channel created, contents uploaded) rather than rejected. Verified it
    fails on unfixed master-v2 and passes with this change.
  • Existing test_stage_submit_deps cases still pass (11 passed). flake8 and
    black -l 100 clean on changed files.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

PySparkProcessor/SparkJarProcessor rejected a local directory passed via
submit_py_files / submit_jars / submit_files: _stage_submit_deps required
os.path.isfile(dep_path) and raised "is not a valid local file" for a
directory. Users could only list individual files.

Accept a directory as well: copy its tree into the staging tempdir (via
shutil.copytree) so its contents are uploaded to the dependency input
channel and mounted into the Spark container, alongside the existing
single-file handling. Update the error message to mention directories.

Add a unit test that a directory is staged (not rejected).

Relates-to aws#2447
@rsareddy0329
rsareddy0329 requested a review from a team as a code owner October 1, 2026 04:48
@rsareddy0329
rsareddy0329 requested a review from papriwal October 1, 2026 04:48
@rsareddy0329
rsareddy0329 deployed to auto-approve October 1, 2026 04:48 — with GitHub Actions Active
@rsareddy0329
rsareddy0329 merged commit 10ce0b2 into aws:master-v2 Oct 5, 2026
13 of 19 checks passed

This branch was successfully deployed

1 active deployment
auto-approve — 4a38cd82 Deployed Oct 1, 2026 by rsareddy0329 via wait-for-approval #241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants