Skip to content

fix: add runtimeProfile builder method and qualify short template names - #227

Merged
dborowitz merged 2 commits into
mainfrom
dborowitz-runtime-profiles
Nov 3, 2026
Merged

dborowitz merged 2 commits into
mainfrom
dborowitz-runtime-profiles

Conversation

@dborowitz

Copy link
Copy Markdown
Contributor

Summary

  1. Qualify bare template/profile names in _get_session_template:

    • CreateSession accepts either a bare session template ID or a fully-qualified projects/.../locations/.../sessionTemplates/... resource name on Session.session_template, whereas GetSessionTemplateRequest.name requires a fully-qualified resource name.
    • When a bare template/profile ID is configured and MANAGED_SPARK_CONNECT_* execution environment variables are set, qualify the name to projects/{project}/locations/{region}/sessionTemplates/{template} before calling GetSessionTemplate so template field precedence is respected.
  2. Add ManagedSparkSession.Builder.runtimeProfile(profile) as an alias for sessionTemplate(profile):

    • Aligns the builder API and README with the Runtime Profile terminology in Cloud Console and public documentation while keeping sessionTemplate(profile) as a supported alias.

CreateSession accepts either a bare session template ID or a
fully-qualified projects/.../locations/.../sessionTemplates/... resource
name on Session.session_template, whereas GetSessionTemplateRequest.name
requires a fully-qualified resource name.

When a bare session template ID is configured and MANAGED_SPARK_CONNECT_*
execution environment variables are present, qualify the template name
to projects/{project}/locations/{region}/sessionTemplates/{template}
before calling GetSessionTemplate so template field precedence is
respected.
Add ManagedSparkSession.Builder.runtimeProfile(profile) to align with the
Runtime Profile terminology in Cloud Console and public documentation,
while keeping sessionTemplate(profile) as a supported alias.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the concept of Runtime Profiles as a replacement for Session Templates, renaming the sessionTemplate builder method to runtimeProfile and keeping sessionTemplate as an alias. Additionally, it updates _get_session_template to automatically qualify bare session template names into full resource URIs when project and region details are available. Corresponding unit tests and documentation updates have been added. I have no further feedback to provide.

@dborowitz
dborowitz requested a review from tim-u October 29, 2026 18:01
@dborowitz dborowitz changed the title feat: add runtimeProfile builder method and qualify short template names fix: add runtimeProfile builder method and qualify short template names Oct 30, 2026
@dborowitz
dborowitz merged commit bd4cf6c into main Nov 3, 2026
20 checks passed
@dborowitz
dborowitz deleted the dborowitz-runtime-profiles branch November 3, 2026 22:20
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