Skip to content

Apply SageMaker operator template-field checks after rendering - #70485

Merged
potiuk merged 1 commit into
apache:mainfrom
mitre88:fix-sagemaker-template-fields
Aug 1, 2026
Merged

Apply SageMaker operator template-field checks after rendering#70485
potiuk merged 1 commit into
apache:mainfrom
mitre88:fix-sagemaker-template-fields

Conversation

@mitre88

@mitre88 mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Two SageMaker operators applied logic to template fields in __init__, before Jinja rendering:

  • SageMakerProcessingOperator rejected output_files_to_xcom without wait_for_completion=True at construction time — a templated output_files_to_xcom that renders empty was rejected anyway. The guard now runs at the top of execute().
  • SageMakerCreateNotebookOperator ran format_tags over create_instance_kwargs["tags"] in __init__, so a templated kwargs dict never got its tags formatted (and the operator mutated its own constructor argument). The formatting now happens in execute() on a copy, leaving the operator's stored kwargs untouched.

Both classes are removed from the exemption list.

related: #70296


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

@vincbeck

Copy link
Copy Markdown
Contributor

Can you rebase? Main was broken but it is now fixed

@eladkal

eladkal commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

There are conflicts to resolve

output_files_to_xcom (SageMakerProcessingOperator) and create_instance_kwargs
(SageMakerCreateNotebookOperator) are template fields, but were validated or
transformed in __init__, before Jinja rendering. The wait_for_completion guard
and the tags formatting now run at execute() time, on rendered values.
@mitre88
mitre88 force-pushed the fix-sagemaker-template-fields branch from d89eaa4 to ef06527 Compare July 31, 2026 22:11
@potiuk
potiuk merged commit 087b2e9 into apache:main Aug 1, 2026
83 checks passed
mitre88 added a commit to mitre88/airflow that referenced this pull request Aug 1, 2026
Rebased onto current main after apache#70485 removed the SageMaker exemptions.
Constructor args now match the templated cluster_id attribute; Neptune
provision-check exemptions are dropped accordingly.
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.

4 participants