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

Merged
merged 6 commits into from
Mar 10, 2025

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.37%. Comparing base (7fe033a) to head (a155bb7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33567   +/-   ##
=======================================
  Coverage   82.37%   82.37%           
=======================================
  Files         120      120           
  Lines        6933     6933           
  Branches     1169     1169           
=======================================
  Hits         5711     5711           
  Misses       1119     1119           
  Partials      103      103           
Flag Coverage Δ
suite.unit 82.37% <ø> (ø)

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.37% <ø> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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
@humanzz
Copy link
Contributor Author

humanzz commented Mar 3, 2025

@GavinZZ this is a PR where I address my comments in #33238 (comment)

@GavinZZ GavinZZ self-assigned this Mar 10, 2025
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Wow, this is awesome! Thank you for the refactoring and typo fixing!

Copy link
Contributor

mergify bot commented Mar 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 10, 2025
Copy link
Contributor

mergify bot commented Mar 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Mar 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 759e692 into aws:main Mar 10, 2025
14 checks passed
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants