This is an automated email from the ASF dual-hosted git repository.
eladkal pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new a2013538a9c [v3-1-test] Fix: Removed the stray 's' and added a unit
test to lock the formatting. (#63712) (#63905)
a2013538a9c is described below
commit a2013538a9c03f1f56f48d531a97fba2e8f95069
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Mar 19 11:07:21 2026 +0200
[v3-1-test] Fix: Removed the stray 's' and added a unit test to lock the
formatting. (#63712) (#63905)
* Fix FileSyntaxError string formatting
* Add newsfragment for FileSyntaxError fix
* Remove newsfragment per review
(cherry picked from commit b9faa656dfb0a576ed5d13a74b90731589697160)
Co-authored-by: Nandan <[email protected]>
---
airflow-core/src/airflow/exceptions.py | 2 +-
airflow-core/tests/unit/always/test_secrets_local_filesystem.py | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/exceptions.py
b/airflow-core/src/airflow/exceptions.py
index 6d65ad87237..a99ea847259 100644
--- a/airflow-core/src/airflow/exceptions.py
+++ b/airflow-core/src/airflow/exceptions.py
@@ -291,7 +291,7 @@ class FileSyntaxError(NamedTuple):
message: str
def __str__(self):
- return f"{self.message}. Line number: s{str(self.line_no)},"
+ return f"{self.message}. Line number: {str(self.line_no)},"
class AirflowFileParseException(AirflowException):
diff --git a/airflow-core/tests/unit/always/test_secrets_local_filesystem.py
b/airflow-core/tests/unit/always/test_secrets_local_filesystem.py
index 2182ccebe96..36975f64b65 100644
--- a/airflow-core/tests/unit/always/test_secrets_local_filesystem.py
+++ b/airflow-core/tests/unit/always/test_secrets_local_filesystem.py
@@ -29,6 +29,7 @@ from airflow.exceptions import (
AirflowException,
AirflowFileParseException,
ConnectionNotUnique,
+ FileSyntaxError,
VariableNotUnique,
)
from airflow.models import Variable
@@ -87,6 +88,12 @@ class TestFileParsers:
local_filesystem.load_variables("a.yaml")
+class TestFileSyntaxError:
+ def test_str(self):
+ error = FileSyntaxError(line_no=10, message="Invalid line format")
+ assert str(error) == "Invalid line format. Line number: 10,"
+
+
class TestLoadVariables:
@pytest.mark.parametrize(
"file_content, expected_variables",