shahar1 opened a new pull request, #66960:
URL: https://github.com/apache/airflow/pull/66960

   A trigger's `__init__` and `serialize()` are written as a pair: any 
`__init__` parameter that `serialize()` does not return is silently dropped 
when the triggerer re-instantiates the trigger, falling back to the parameter's 
default. This kind of mismatch is easy to introduce and hard to spot in review.
   
   This adds an AST-based prek static check over provider trigger modules 
(`*/src/airflow/providers/*/triggers/*.py`) that flags such mismatches.
   
   ## Details
   
   - Resolves the `__init__`/`serialize()` pair through **in-file base 
classes**, so a class that inherits one and overrides the other is still 
checked. Also follows `**super().serialize()[1]` spreads recursively.
   - When neither the signature nor the serialize dict can be resolved 
statically (dynamic dict construction, `.update()`, base class in another 
file), it **skips** rather than guessing — no false positives.
   - 8 pre-existing failures were found and reviewed:
     - **5 genuine violations** are listed in `KNOWN_VIOLATIONS` and excluded 
for now; they will be fixed in a follow-up PR (`DatabricksExecutionTrigger`, 
`DatabricksSQLStatementExecutionTrigger`, `BigQueryIntervalCheckTrigger`, 
`DataFusionStartPipelineTrigger`, `LivyTrigger`).
     - **3 by-design cases** are permanently excluded in `BY_DESIGN_EXCLUSIONS` 
with documented reasons — a deprecated/aliased parameter (`delta` → `moment`, 
`pod_name` → `pod_names`) is folded into its replacement at construction time, 
so it does not need to round-trip.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Sonnet 4.6)
   
   Generated-by: Claude Code (Sonnet 4.6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to