Skip to content

Restrict BASE_TRIGGER deserialization to BaseTrigger subclasses#67926

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:validate-base-trigger-deserialization-type
Open

Restrict BASE_TRIGGER deserialization to BaseTrigger subclasses#67926
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:validate-base-trigger-deserialization-type

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Jun 2, 2026

When loading a serialized DAG, the BASE_TRIGGER deserialization branch in BaseSerialization.deserialize imported the stored class path and instantiated it without checking it is actually a BaseTrigger subclass. This restricts that path to BaseTrigger subclasses (raising ValueError otherwise), matching the encode side which only emits BASE_TRIGGER for BaseTrigger instances.

Tests

  • Added test_base_trigger_deserialization_rejects_non_trigger_class — a non-BaseTrigger class path is rejected.
  • Existing test_trigger_kwargs_not_deserialised_through_serdag still passes.
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Opus 4.8 (1M context)

Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

When loading a serialized DAG, the BASE_TRIGGER deserialization branch
imported the stored class path and instantiated it without checking it
is a BaseTrigger subclass. Restrict it to BaseTrigger subclasses,
matching the encode side which only emits BASE_TRIGGER for BaseTrigger
instances.

Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
@potiuk potiuk requested review from ashb and bolkedebruin as code owners June 2, 2026 22:50
@potiuk potiuk added this to the Airflow 3.3.0 milestone Jun 2, 2026
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.

1 participant