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

   `suppress_logs_and_warning` in `airflow/utils/cli.py` called the wrapped 
function on both of its branches (`--verbose` and not) without returning the 
result, so every caller received `None`. The other decorators stacked on CLI 
command functions (`action_cli`, `providers_configuration_loaded`, 
`provide_session`) all pass the return value through, so this one was the odd 
one out.
   
   This is a decorator-transparency fix, not a user-facing bug fix: none of the 
49 commands currently decorated (core CLI commands plus the FAB provider's 
`users`/`roles` commands) returns a value from its own body, and 
`airflow/__main__.py` discards the result of `args.func(args)`. Nothing 
observable changes today; the change removes a trap for any future command that 
does return something.
   
   The `else:` block is flattened because ruff rule `RET505` (enabled in 
`pyproject.toml`) rejects an `else` after `return`. The body of that block is 
unchanged apart from the added `return`; the restore logic in `finally` still 
runs before the value is returned.
   
   A parametrized test covers both branches and fails on `main`. It carries 
`@pytest.mark.non_db_test_override` because the test module is marked `db_test` 
at module level while this test needs no database.
   
   No newsfragment: no user-visible behaviour change.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.1)
   
   Generated-by: Claude Code (Fable 5.1) 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