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

   ## Summary
   
   Enables ruff rule **B008** (`function-call-in-default-argument`) which 
catches function calls used as default argument values — a common source of 
bugs where mutable objects or config reads are shared across all calls instead 
of being fresh per call.
   
   - Adds `[tool.ruff.lint.flake8-bugbear] extend-immutable-calls` to exempt 
FastAPI DI callables (`Depends`, `Query`, `Path`, `Body`, `Security`) and the 
stateless `cryptography` SHA256 descriptor, which are intentionally used in 
argument defaults
   - Fixes **13 real violations** across core, task-sdk, shared libs, and 
providers:
     - **task-sdk `BaseSensorMixin`**: `conf.getfloat("sensors", 
"default_timeout")` was read once at import time; now read at instantiation
     - **task-sdk `Resources`**: `conf.getint(...)` for 
`cpus`/`ram`/`disk`/`gpus` read at import time; now read at instantiation
     - **providers/google `S3ToGCSOperator`**: `conf.getboolean("operators", 
"default_deferrable")` read at import time
     - **providers/google Vertex AI Ray hook and operator**: 
`resources.Resources()` mutable default shared across all calls
     - **shared/observability** (`SafeStatsdLogger`, `SafeDogStatsdLogger`, 
`SafeOtelLogger`): `PatternAllowListValidator()` mutable instances shared 
across all logger instances
     - **openlineage system test**: `setup_jinja()` mutable Jinja `Environment` 
shared across operator instances
     - **api_fastapi `LimitFilter.depends`**: `conf.getint("api", 
"fallback_page_limit")` in FastAPI dependency method moved to module-level 
constant `_FALLBACK_PAGE_LIMIT`, preserving the OpenAPI schema default value 
while making the intent explicit
     - **providers/fab test conftest**: `types.SimpleNamespace(...)` mutable 
default in context manager helper
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Sonnet 4.6 (claude-sonnet-4-6)
   
   Generated-by: Claude Sonnet 4.6 (claude-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