Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(glue-alpha): refactor spark jobs code-related props handling #33567

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

humanzz
Copy link
Contributor

@humanzz humanzz commented Feb 24, 2025

Issue # (if applicable)

Related to #33356

Reason for this change

address the feedback section of extraJars, extraFiles, extraPythonFiles, extraJarsFirst + refactor to reduce duplicative code across the different spark job classes

Description of changes

  • update the different spark jobs props to
    • make extraPythonFiles, extraFiles, extraJars, and extraJarsFirst available in pyspark jobs
    • make extraFiles, extraJars, and extraJarsFirst available in scala spark jobs
  • introduce a base SparkJob class and SparkJobProps to reduce duplicate logic across different spark job classes
    • introduce setupSparkCodeArguments protected method along with an interface SparkExtraCodeProps to handle setting up Code-related arguments
    • fix spark ui setup to be consistent with docs for sparkUI prop
    • merge content of spark-ui-utils.ts into spark-job.ts and retire it
    • cleanup comma expression for role setup
  • fix typos and do renames to follow conventions

Describe any new or updated permissions being added

N/A

Description of how you validated changes

updated unit tests

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Feb 24, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 24, 2025 14:42
@github-actions github-actions bot added the admired-contributor [Pilot] contributed between 13-24 PRs to the CDK label Feb 24, 2025
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.20%. Comparing base (5eeee75) to head (ae6fa41).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33567   +/-   ##
=======================================
  Coverage   82.20%   82.20%           
=======================================
  Files         119      119           
  Lines        6862     6862           
  Branches     1158     1158           
=======================================
  Hits         5641     5641           
  Misses       1118     1118           
  Partials      103      103           
Flag Coverage Δ
suite.unit 82.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.20% <ø> (ø)

@humanzz
Copy link
Contributor Author

humanzz commented Feb 24, 2025

After the second commit, I had to export SparkExtraCodeProps and SparkUIConfiguration to pass JSII issues from the 1st commit.

Another thought I'm having is that there's a lot of duplicative logic in the different spark job classes, and I wonder if it can be simplified by either (1) Extracting common protected methods into Job or (2) introduction of a new intermediate base class for spark jobs, any thoughts?

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 24, 2025
@humanzz humanzz changed the title chore(glue-alpha): address spark jobs code-related props feedback chore(glue-alpha): refactor spark jobs code-related props handling Feb 24, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ae6fa41
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants