You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ch...@apache.org on 2026/05/04 09:08:38 UTC
(airflow) branch v3-2-test updated: [v3-2-test] Iterate file objects directly instead of calling readlines() (#66291) (#66320)
This is an automated email from the ASF dual-hosted git repository.
choo121600 pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-2-test by this push:
new dd65e3c6b96 [v3-2-test] Iterate file objects directly instead of calling readlines() (#66291) (#66320)
dd65e3c6b96 is described below
commit dd65e3c6b96c85aba5f58c7a30a7b931f1a35d91
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Mon May 4 18:08:31 2026 +0900
[v3-2-test] Iterate file objects directly instead of calling readlines() (#66291) (#66320)
(cherry picked from commit 2cde0be3bd11230e86a1da319ef7e2bc7fabf838)
Co-authored-by: Colten <70...@users.noreply.github.com>
---
dev/airflow_perf/sql_queries.py | 2 +-
dev/breeze/src/airflow_breeze/global_constants.py | 2 +-
devel-common/src/sphinx_exts/redirects.py | 2 +-
.../google/tests/system/google/cloud/gcs/resources/transform_script.py | 2 +-
scripts/ci/prek/newsfragments.py | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dev/airflow_perf/sql_queries.py b/dev/airflow_perf/sql_queries.py
index a0164309d98..f16f9cb4d9e 100644
--- a/dev/airflow_perf/sql_queries.py
+++ b/dev/airflow_perf/sql_queries.py
@@ -145,7 +145,7 @@ def make_report() -> list[Query]:
"""
queries = []
with open(LOG_FILE, "r+") as f:
- raw_queries = [line for line in f.readlines() if is_query(line)]
+ raw_queries = [line for line in f if is_query(line)]
for query in raw_queries:
time, info, stack, sql = query.replace("@SQLALCHEMY ", "").split("|$")
diff --git a/dev/breeze/src/airflow_breeze/global_constants.py b/dev/breeze/src/airflow_breeze/global_constants.py
index 24edcf9c16c..84f5e80f409 100644
--- a/dev/breeze/src/airflow_breeze/global_constants.py
+++ b/dev/breeze/src/airflow_breeze/global_constants.py
@@ -710,7 +710,7 @@ def get_task_sdk_version():
def get_airflow_extras():
airflow_dockerfile = AIRFLOW_ROOT_PATH / "Dockerfile"
with open(airflow_dockerfile) as dockerfile:
- for line_raw in dockerfile.readlines():
+ for line_raw in dockerfile:
if "ARG AIRFLOW_EXTRAS=" in line_raw:
line = line_raw.split("=")[1].strip()
return line.replace('"', "")
diff --git a/devel-common/src/sphinx_exts/redirects.py b/devel-common/src/sphinx_exts/redirects.py
index f9345c58ba9..f03a49b7abe 100644
--- a/devel-common/src/sphinx_exts/redirects.py
+++ b/devel-common/src/sphinx_exts/redirects.py
@@ -41,7 +41,7 @@ def generate_redirects(app):
return
with open(redirect_file_path) as redirects:
- for line in redirects.readlines():
+ for line in redirects:
# Skip empty line
if not line.strip():
continue
diff --git a/providers/google/tests/system/google/cloud/gcs/resources/transform_script.py b/providers/google/tests/system/google/cloud/gcs/resources/transform_script.py
index dffe1aaf4b5..31f02e4b557 100644
--- a/providers/google/tests/system/google/cloud/gcs/resources/transform_script.py
+++ b/providers/google/tests/system/google/cloud/gcs/resources/transform_script.py
@@ -23,6 +23,6 @@ destination = sys.argv[2]
print("Running script")
with open(source) as src, open(destination, "w+") as dest:
- lines = [line.upper() for line in src.readlines()]
+ lines = [line.upper() for line in src]
print(lines)
dest.writelines(lines)
diff --git a/scripts/ci/prek/newsfragments.py b/scripts/ci/prek/newsfragments.py
index cb994b44c13..41704cd4bb0 100755
--- a/scripts/ci/prek/newsfragments.py
+++ b/scripts/ci/prek/newsfragments.py
@@ -67,7 +67,7 @@ def main(filenames: list[str]) -> int:
failed = False
for filename in filenames:
with open(filename) as f:
- lines = [line.strip() for line in f.readlines()]
+ lines = [line.strip() for line in f]
errors = validate_newsfragment(filename, lines)
for error in errors:
print(error)