You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "shahar1 (via GitHub)" <gi...@apache.org> on 2026/05/15 05:14:27 UTC
[PR] Enable ruff PLE1205 to catch logging calls with too many arguments [airflow]
shahar1 opened a new pull request, #66978:
URL: https://github.com/apache/airflow/pull/66978
When a `logging` call has more positional arguments than the format string has `%`-placeholders, the extra arguments are silently dropped and the intended information never appears in the log. Enable `PLE1205` (`logging-too-many-args`) to make this a lint error, and fix all 12 existing instances.
## Changes
- **\`pyproject.toml\`**: add `PLE1205` to `extend-select`.
- **\`airflow-core\`** (1): add missing `%s` placeholder for the caught `OSError` in `file_task_handler.py`.
- **\`provider:amazon\`** (4):
- `redshift_data.py`: collapse two-string call into `"Invalid poll_interval: %s", poll_interval`
- `ssm.py`: merge accidentally split message strings into one format string with `%s`
- `task_log_fetcher.py` (×2): add `%s` for the captured exception
- **\`provider:google\`** (7):
- `compute.py` (×2): add `%s` so `self.body` is actually logged
- `drive.py`: add `%s` for the `GoogleApiClientError`
- Four system-test example files using `{}` placeholders (logging uses `%s`, not `.format()` syntax)
---
##### 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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enable ruff PLE1205 to catch logging calls with too many arguments [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 merged PR #66978:
URL: https://github.com/apache/airflow/pull/66978
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enable ruff PLE1205 to catch logging calls with too many arguments [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #66978:
URL: https://github.com/apache/airflow/pull/66978#discussion_r3246732332
##########
providers/google/src/airflow/providers/google/suite/hooks/drive.py:
##########
@@ -304,7 +304,7 @@ def upload_file(
try:
upload_location = self._resolve_file_path(folder_id)
except GoogleApiClientError as e:
- self.log.warning("A problem has been encountered when trying to resolve file path: ", e)
+ self.log.warning("A problem has been encountered when trying to resolve file path: %s", e)
Review Comment:
```suggestion
self.log.exception("A problem has been encountered when trying to resolve file path:")
```
should we just go with this instead?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enable ruff PLE1205 to catch logging calls with too many arguments [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on code in PR #66978:
URL: https://github.com/apache/airflow/pull/66978#discussion_r3246050099
##########
providers/amazon/src/airflow/providers/amazon/aws/sensors/ssm.py:
##########
@@ -108,11 +108,7 @@ def poke(self, context: Context):
command_invocations = response.get("CommandInvocations", [])
if not command_invocations:
- self.log.info(
- "No command invocations found",
- "command_id=%s yet, waiting...",
- self.command_id,
Review Comment:
That's a sneaky one :)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enable ruff PLE1205 to catch logging calls with too many arguments [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #66978:
URL: https://github.com/apache/airflow/pull/66978#discussion_r3247127268
##########
providers/amazon/src/airflow/providers/amazon/aws/sensors/ssm.py:
##########
@@ -108,11 +108,7 @@ def poke(self, context: Context):
command_invocations = response.get("CommandInvocations", [])
if not command_invocations:
- self.log.info(
- "No command invocations found",
- "command_id=%s yet, waiting...",
- self.command_id,
Review Comment:
Good find!
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org