Skip to content

Fix provider triggers whose serialize() drops __init__ parameters #66961

Closed

Description

@shahar1

Body

A trigger's __init__ and serialize() are written as a pair: every __init__ parameter must appear in the serialize() return dict, otherwise it is silently dropped when the triggerer re-instantiates the trigger and falls back to the parameter's default. See deferring.rst.

The new check-trigger-serialize-init static check (added in #66960) flags this class of bug. It found 5 pre-existing genuine violations, which are currently allowlisted in KNOWN_VIOLATIONS in scripts/ci/prek/check_trigger_serialize_init.py so the check could be enabled. This issue tracks fixing them and removing them from the allowlist.

For each trigger below: add the missing parameter(s) to the serialize() return dict, add/extend a serialization unit test asserting the parameter round-trips, and remove the entry from KNOWN_VIOLATIONS.

Checklist

  • DatabricksExecutionTrigger — caller missing (providers/databricks/src/airflow/providers/databricks/triggers/databricks.py)
  • DatabricksSQLStatementExecutionTrigger — caller missing (providers/databricks/src/airflow/providers/databricks/triggers/databricks.py)
  • BigQueryIntervalCheckTrigger — dataset_id, table_id, poll_interval missing (providers/google/src/airflow/providers/google/cloud/triggers/bigquery.py)
  • DataFusionStartPipelineTrigger — poll_interval, impersonation_chain missing (providers/google/src/airflow/providers/google/cloud/triggers/datafusion.py)
  • LivyTrigger — endpoint_prefix missing (providers/apache/livy/src/airflow/providers/apache/livy/triggers/livy.py)
  • Remove all fixed entries from KNOWN_VIOLATIONS in scripts/ci/prek/check_trigger_serialize_init.py (the set should end up empty)

Notes

These can be fixed individually (one PR per trigger / provider) or together. Note that BY_DESIGN_EXCLUSIONS in the same file is intentionally permanent and should not be touched — those cases (TimeDeltaTrigger, GKEJobTrigger, KubernetesJobTrigger) fold a deprecated/aliased parameter into its replacement at construction time and are correct as-is.

Related: #66960


Drafted-by: Claude Code (Sonnet 4.6) (human reviewed)

Activity

  1. Nishieee commented on May 14, 2026

    @Nishieee
    Contributor

    I’d love to work on this issue.

    I’ll align each trigger’s serialize() return dict with its init parameters (adding any missing fields like caller / poll_interval / endpoint_prefix, storing values on self where needed) and add focused unit tests that round-trip serialize() --> **kwargs --> reinstantiation. Once the static check is clean, I’ll remove the corresponding entries from KNOWN_VIOLATIONS.

  2. shahar1 commented on May 14, 2026

    @shahar1
    ContributorAuthor

    I’d love to work on this issue.

    I’ll align each trigger’s serialize() return dict with its init parameters (adding any missing fields like caller / poll_interval / endpoint_prefix, storing values on self where needed) and add focused unit tests that round-trip serialize() --> **kwargs --> reinstantiation. Once the static check is clean, I’ll remove the corresponding entries from KNOWN_VIOLATIONS.

    Thank you, feel free to raise PRs.

  3. abhid-007 commented on May 15, 2026

    @abhid-007

    Picking up BigQueryIntervalCheckTrigger (the last of the five) — looks like @Nishieee has the other four covered in #66965 / #66966 / #66968 / and the Databricks Run trigger. Will keep the PR narrow to this single trigger and cross-reference #66960 so the KNOWN_VIOLATIONS entry can be removed from that side once both land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions