Skip to content

Amazon emr serverless get session endpoint - #70766

Merged
vincbeck merged 1 commit into
apache:mainfrom
vgkowski:amazon-emr-serverless-get-session-endpoint
Oct 14, 2026
Merged

vincbeck merged 1 commit into
apache:mainfrom
vgkowski:amazon-emr-serverless-get-session-endpoint

Conversation

@vgkowski

Copy link
Copy Markdown
Contributor

Add EmrServerlessGetSessionEndpointOperator, which resolves the Spark Connect
endpoint URL and a short-lived authentication token for a running EMR Serverless
interactive session so a client can attach to it.

Why:

  • Each interactive session has its own endpoint and a token that expires (~1 hour),
    so the endpoint must be fetched fresh right before connecting rather than cached.
  • The token is a short-lived credential, so the operator registers it with Airflow's
    secrets masker before returning it via XCom, keeping it out of task logs and the
    rendered XCom value in the UI.

Changes:

  • EmrServerlessHook.get_session_endpoint returns the raw GetSessionEndpoint boto3
    response (thin wrapper, per the provider convention); the operator does the field
    transformation before pushing to XCom.
  • Add mask_secret to the common.compat SDK shim so the masker import resolves across
    supported Airflow versions.
  • Docs (howto section), a system-test example step, and unit tests.

The feature is gated on botocore >= 1.43.0 at runtime (introduced in the base PR), so
the provider's dependency floor is unchanged.

Note

This PR is part of a stack and depends on
#70763 (adds
EmrServerlessStartSessionOperator and the shared session plumbing). Please review/merge
that one first — this PR's base branch is vgkowski/amazon-emr-serverless-start-session until it
lands, then it retargets to main.

Was generative AI tooling used to co-author this PR?
  • Yes — Kiro (AI coding assistant)

Generated-by: Kiro, following the Gen-AI guidelines in contributing-docs/05_pull_requests.rst

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 19, 2026
@vgkowski
vgkowski force-pushed the amazon-emr-serverless-get-session-endpoint branch from 2a21b55 to 03f5cca Compare September 26, 2026 10:52
@github-actions github-actions Bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 27, 2026
@vgkowski
vgkowski marked this pull request as ready for review September 29, 2026 18:32
@vgkowski
vgkowski requested a review from o-nikolas as a code owner September 29, 2026 18:32
@vgkowski
vgkowski force-pushed the amazon-emr-serverless-get-session-endpoint branch from 03f5cca to f303fe9 Compare September 29, 2026 19:16
@vgkowski

Copy link
Copy Markdown
Contributor Author

@vincbeck @o-nikolas this is the next step for EMR-S session integration

Comment thread providers/amazon/src/airflow/providers/amazon/aws/hooks/emr.py Outdated
Spark Connect clients need a session's endpoint and a short-lived auth
token to attach to an EMR Serverless interactive session. Fetching them
in their own task, right before the connecting task, keeps the token
fresh.

The token is a credential, so it is masked in task logs. Airflow 3
redacts task logs in the supervisor, so common.compat resolves
mask_secret to the variant that forwards the mask there, and falls back
to the older locations on earlier Airflow versions. The token remains
readable in XCom, which the docs call out.
@vgkowski
vgkowski force-pushed the amazon-emr-serverless-get-session-endpoint branch from f303fe9 to 1b77352 Compare October 13, 2026 14:26
@vincbeck
vincbeck merged commit 90ea1b7 into apache:main Oct 14, 2026
223 of 224 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants