You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add test to verify parameters match between operator and decorator #48448
Hi [@gomtangman], I noticed you’re assigned to this issue. I’d love to contribute here too—are you open to collaboration? I’m happy to pair-program, tackle a subtask, or review your work. Let me know how I can assist!
Hi @Shweta-281
I became busy doing my work to keep up with this issue.
So if you are still interested in this issue, can you work on it instead of me?
I thought it would be good to test whether the test is covering all the decorators.
So, I searched for a way to retrieve all the decorators but I failed to find one.
If you can find a way to ensure all the decorators are tested, I think that'll increase the quality of tests.
@amoghrajesh@isharghura the work is done and it was failing in static checks when i raised PR alone. #51048
may be i can try running it again and verify it before next wednesday.
I would like to take this one, and I measured the drift first so the scope is based on numbers rather than guesses.
A static scan — ast only, nothing imported — of task-sdk/src/airflow/sdk/definitions/decorators/__init__.pyi against the operator behind each task-decorators entry registered in provider.yaml finds:
11 registered decorators with no stub entry at all: agent, analytics, llm, llm_branch, llm_file_analysis, llm_schema_compare, llm_sql, sftp_sensor, snowpark, sql, stub. @task.llm(...) and friends fall back to __getattr__ today, so they get no parameter checking at all.
Parameter drift in 7 of the 13 decorators that do have a stub. A few examples: python is missing templates_exts, which PythonOperator.__init__ accepts; virtualenv and external_python are missing string_args, templates_exts and expect_airflow; kubernetes and kubernetes_cmd are each missing around thirteen KubernetesPodOperator parameters, including cmds, callbacks, logging_interval and runtime_class_name.
Not every difference is drift. use_dill, serializer and python_command exist only on the decorator side, and bash_command, command and arguments are deliberately supplied by the decorated function rather than the caller, so the check needs an explicit exemption list instead of a strict equality assertion.
On where the check should live: the earlier attempt in #51048 needed Airflow importable to compare signatures, which pushed it into an in-container script and is where it got stuck. Comparing the stub against the operator __init__ can be done entirely statically, so it fits a plain scripts/ci/prek/ hook with no Airflow dependency and no container, runnable on a clean checkout. I have a working prototype of that comparison, which is where the numbers above come from.
Three questions before I write the real thing:
Is a static prek hook the shape you want, or would you still rather have this in the test suite?
Are the 11 missing decorators in scope here, or a follow-up? Adding them means writing stubs for provider decorators that never had one.
For the drift the check finds, should the same PR fix the stubs — the kubernetes ones are the bulk of it — or should the check land with those exempted and the fixes follow per provider?
Drafted-by: Claude Opus 5 (1M context); reviewed by @wfatih before posting
I would like to take this one and I've opened a draft PR. I did a check but not yet find an active development. Would appreciate any review feedback. Thanks!
Activity
gomtangman commentedon Mar 27, 2025
Hi!
Can I take this issue and work on it?
Shweta-281 commentedon Mar 29, 2025
Hi [@gomtangman], I noticed you’re assigned to this issue. I’d love to contribute here too—are you open to collaboration? I’m happy to pair-program, tackle a subtask, or review your work. Let me know how I can assist!
gomtangman commentedon Mar 29, 2025
@Shweta-281 Thank you for your suggestion
I am writing a test now. So can you review it when I make a pull request?
gomtangman commentedon Apr 3, 2025
Hi @Shweta-281
I became busy doing my work to keep up with this issue.
So if you are still interested in this issue, can you work on it instead of me?
I thought it would be good to test whether the test is covering all the decorators.
So, I searched for a way to retrieve all the decorators but I failed to find one.
If you can find a way to ensure all the decorators are tested, I think that'll increase the quality of tests.
Debasishpradhan28 commentedon Apr 8, 2025
I want to take this issue and work on it. can I ?
gomtangman commentedon Apr 8, 2025
@Debasishpradhan28
Yes, please take it
amoghrajesh commentedon Jun 13, 2025
Looks like @Bowrna is already on it. Assigning to her.
isharghura commentedon Nov 12, 2025
Hi can I take this issue?
Bowrna commentedon Nov 13, 2025
@amoghrajesh @isharghura the work is done and it was failing in static checks when i raised PR alone. #51048
may be i can try running it again and verify it before next wednesday.
Stuaarts commentedon Aug 31, 2026
Hi, I'd like to work on this issue as my first contribution to Airflow. Is it still available ?
wfatih commentedon Sep 20, 2026
I would like to take this one, and I measured the drift first so the scope is based on numbers rather than guesses.
A static scan —
astonly, nothing imported — oftask-sdk/src/airflow/sdk/definitions/decorators/__init__.pyiagainst the operator behind eachtask-decoratorsentry registered inprovider.yamlfinds:agent,analytics,llm,llm_branch,llm_file_analysis,llm_schema_compare,llm_sql,sftp_sensor,snowpark,sql,stub.@task.llm(...)and friends fall back to__getattr__today, so they get no parameter checking at all.pythonis missingtemplates_exts, whichPythonOperator.__init__accepts;virtualenvandexternal_pythonare missingstring_args,templates_extsandexpect_airflow;kubernetesandkubernetes_cmdare each missing around thirteenKubernetesPodOperatorparameters, includingcmds,callbacks,logging_intervalandruntime_class_name.Not every difference is drift.
use_dill,serializerandpython_commandexist only on the decorator side, andbash_command,commandandargumentsare deliberately supplied by the decorated function rather than the caller, so the check needs an explicit exemption list instead of a strict equality assertion.On where the check should live: the earlier attempt in #51048 needed Airflow importable to compare signatures, which pushed it into an in-container script and is where it got stuck. Comparing the stub against the operator
__init__can be done entirely statically, so it fits a plainscripts/ci/prek/hook with no Airflow dependency and no container, runnable on a clean checkout. I have a working prototype of that comparison, which is where the numbers above come from.Three questions before I write the real thing:
Drafted-by: Claude Opus 5 (1M context); reviewed by @wfatih before posting
sjyangkevin commentedon Oct 14, 2026
I would like to take this one and I've opened a draft PR. I did a check but not yet find an active development. Would appreciate any review feedback. Thanks!