Skip to content

Commit e9253f4

Browse files
dependabot[bot]hf-kkleinCopilot
authored
build(deps-dev): bump black from 25.12.0 to 26.1.0 (#239)
* build(deps-dev): bump black from 25.12.0 to 26.1.0 Bumps [black](https://github.com/psf/black) from 25.12.0 to 26.1.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@25.12.0...26.1.0) --- updated-dependencies: - dependency-name: black dependency-version: 26.1.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * style: reformat codebase with black 26.1.0 (#248) * Initial plan * style: reformat codebase with black 26.1.0 Co-authored-by: hf-kklein <23094997+hf-kklein@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hf-kklein <23094997+hf-kklein@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: hf-kklein <23094997+hf-kklein@users.noreply.github.com>
1 parent c1db221 commit e9253f4

9 files changed

Lines changed: 26 additions & 46 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ coverage = [
3636
"coverage==7.13.4"
3737
]
3838
formatting = [
39-
"black==25.12.0",
39+
"black==26.1.0",
4040
"isort==8.0.1"
4141
]
4242
linting = [

src/fundamend/reader/ahbreader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ def get_version(self) -> str:
189189

190190
def get_bedingungen(self) -> list[Bedingung]:
191191
"""returns the plain bedingungen"""
192-
return [_to_bedingung(x) for x in self._element_tree.getroot().find("Bedingungen")] # type:ignore[union-attr]
192+
return [_to_bedingung(x) for x in self._element_tree.getroot().find("Bedingungen")] # type: ignore[union-attr]
193193

194194
def get_ub_bedingungen(self) -> list[UbBedingung]:
195195
"""returns the UB Bedingungen"""
196196
return [
197-
_to_ub_bedingung(x) for x in self._element_tree.getroot().find("UB_Bedingungen") # type:ignore[union-attr]
197+
_to_ub_bedingung(x) for x in self._element_tree.getroot().find("UB_Bedingungen") # type: ignore[union-attr]
198198
]
199199

200200
def get_pakete(self) -> list[Paket]:
201201
"""returns the package definitions"""
202-
return [_to_paket(x) for x in self._element_tree.getroot().find("Pakete")] # type:ignore[union-attr]
202+
return [_to_paket(x) for x in self._element_tree.getroot().find("Pakete")] # type: ignore[union-attr]
203203

204204
def get_anwendungsfall(self, pruefidentifikator: str) -> Anwendungsfall | None:
205205
"""find the anwendungsfall matching the pruefidentifikator or return None"""

src/fundamend/sqlmodels/ahbtabellen_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def create_ahbtabellen_view(session: Session) -> None:
2525
"""
2626
_execute_bare_sql(session=session, path_to_sql_commands=Path(__file__).parent / "create_ahbtabellen_view.sql")
2727
number_of_rows = session.scalar(
28-
select(func.count(AhbTabellenLine.id)) # type:ignore[arg-type] # pylint:disable=not-callable
28+
select(func.count(AhbTabellenLine.id)) # type: ignore[arg-type] # pylint:disable=not-callable
2929
)
3030
_logger.info(
3131
"There are %d rows in the AHBTabellen view %s",

src/fundamend/sqlmodels/ahbview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_ahb_view(session: Session) -> None:
5252
_execute_bare_sql(session=session, path_to_sql_commands=Path(__file__).parent / "materialize_ahb_view.sql")
5353

5454
number_of_inserted_rows = session.scalar(
55-
select(func.count(AhbHierarchyMaterialized.id)) # type:ignore[arg-type] # pylint:disable=not-callable #
55+
select(func.count(AhbHierarchyMaterialized.id)) # type: ignore[arg-type] # pylint:disable=not-callable #
5656
)
5757
_logger.info(
5858
"Inserted %d rows into the materialized view %s",

src/fundamend/sqlmodels/anwendungshandbuch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def to_model(self) -> PydanticSegment:
223223
data_elements=tuple(
224224
x.to_model()
225225
for x in sorted(
226-
(self.data_elements or []) + (self.data_element_groups or []), # type:ignore[operator]
226+
(self.data_elements or []) + (self.data_element_groups or []), # type: ignore[operator]
227227
key=lambda y: y.position or 0,
228228
)
229229
),
@@ -316,7 +316,7 @@ def to_model(self) -> PydanticSegmentGroup:
316316
elements=tuple(
317317
x.to_model()
318318
for x in sorted(
319-
(self.segments or []) + (self.segment_groups or []), # type:ignore[operator]
319+
(self.segments or []) + (self.segment_groups or []), # type: ignore[operator]
320320
key=lambda y: y.position or 0,
321321
)
322322
),
@@ -392,7 +392,7 @@ def to_model(self) -> PydanticAnwendungsfall:
392392
elements=tuple(
393393
x.to_model()
394394
for x in sorted(
395-
((self.segments or []) + (self.segment_groups or [])), # type:ignore[operator]
395+
((self.segments or []) + (self.segment_groups or [])), # type: ignore[operator]
396396
key=lambda y: y.position or 0,
397397
)
398398
),

src/fundamend/sqlmodels/expression_view.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def create_and_fill_ahb_expression_table(session: Session, use_cpu_intensive_val
170170
ahb_status_col,
171171
AhbHierarchyMaterialized.anwendungshandbuch_primary_key,
172172
)
173-
rows.extend(session.exec(stmt)) # type:ignore[arg-type]
173+
rows.extend(session.exec(stmt)) # type: ignore[arg-type]
174174
non_empty_rows: list[tuple[EdifactFormatVersion, str, str, uuid.UUID]] = [
175-
r for r in rows if r[2] is not None and r[0] is not None and r[2].strip() # type:ignore[misc]
175+
r for r in rows if r[2] is not None and r[0] is not None and r[2].strip() # type: ignore[misc]
176176
]
177177
if not any(rows):
178178
raise ValueError(
@@ -184,7 +184,7 @@ def create_and_fill_ahb_expression_table(session: Session, use_cpu_intensive_val
184184
row
185185
for row in non_empty_rows
186186
if (key := (row[0], row[1], row[2].strip())) not in seen
187-
and not seen.add(key) # type:ignore[ func-returns-value]
187+
and not seen.add(key) # type: ignore[ func-returns-value]
188188
]
189189
ahb_expression_rows: list[AhbExpression] = []
190190
for row in unique_rows: # there are ~3600 unique rows for FV2410+FV2504 as of 2025-04-15

src/fundamend/sqlmodels/messageimplementationguide.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def to_model(self) -> PydanticSegment:
246246
data_elements=tuple(
247247
x.to_model()
248248
for x in sorted(
249-
(self.data_elements or []) + (self.data_element_groups or []), # type:ignore[operator]
249+
(self.data_elements or []) + (self.data_element_groups or []), # type: ignore[operator]
250250
key=lambda y: y.position or 0,
251251
)
252252
),
@@ -342,7 +342,7 @@ def to_model(self) -> PydanticSegmentGroup:
342342
elements=tuple(
343343
x.to_model()
344344
for x in sorted(
345-
(self.segments or []) + (self.segment_groups or []), # type:ignore[operator]
345+
(self.segments or []) + (self.segment_groups or []), # type: ignore[operator]
346346
key=lambda y: y.position or 0,
347347
)
348348
),
@@ -416,7 +416,7 @@ def to_model(self) -> PydanticMessageImplementationGuide:
416416
elements=tuple(
417417
x.to_model()
418418
for x in sorted(
419-
((self.segments or []) + (self.segment_groups or [])), # type:ignore[operator]
419+
((self.segments or []) + (self.segment_groups or [])), # type: ignore[operator]
420420
key=lambda y: y.position or 0,
421421
)
422422
),

unittests/test_ahb_diff_view.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,14 @@ def test_diff_view_no_duplicate_id_paths(session_fv2410_fv2504_with_diff_view: S
7979
Test that there are no duplicate id_paths for the same version pair comparison.
8080
Each id_path should appear exactly once in the diff results.
8181
"""
82-
result = session_fv2410_fv2504_with_diff_view.execute(
83-
text(
84-
"""
82+
result = session_fv2410_fv2504_with_diff_view.execute(text("""
8583
SELECT id_path, COUNT(*) as cnt
8684
FROM v_ahb_diff
8785
WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
8886
AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
8987
GROUP BY id_path
9088
HAVING COUNT(*) > 1
91-
"""
92-
)
93-
)
89+
"""))
9490
duplicates = list(result)
9591
assert len(duplicates) == 0, f"Found duplicate id_paths in diff results: {duplicates[:5]}"
9692

@@ -100,9 +96,7 @@ def test_diff_view_added_rows_have_null_old_columns(session_fv2410_fv2504_with_d
10096
Test that 'added' rows have NULL values for old_* columns and populated new_* columns.
10197
This verifies the SQL is correctly setting NULL for the old version.
10298
"""
103-
result = session_fv2410_fv2504_with_diff_view.execute(
104-
text(
105-
"""
99+
result = session_fv2410_fv2504_with_diff_view.execute(text("""
106100
SELECT
107101
SUM(CASE WHEN old_segment_code IS NOT NULL THEN 1 ELSE 0 END) as old_segment_not_null,
108102
SUM(CASE WHEN old_line_ahb_status IS NOT NULL THEN 1 ELSE 0 END) as old_status_not_null,
@@ -111,9 +105,7 @@ def test_diff_view_added_rows_have_null_old_columns(session_fv2410_fv2504_with_d
111105
WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
112106
AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
113107
AND diff_status = 'added'
114-
"""
115-
)
116-
)
108+
"""))
117109
row = list(result)[0]
118110
assert row[0] == 0, "Added rows should have NULL old_segment_code"
119111
assert row[1] == 0, "Added rows should have NULL old_line_ahb_status"
@@ -125,9 +117,7 @@ def test_diff_view_deleted_rows_have_null_new_columns(session_fv2410_fv2504_with
125117
Test that 'deleted' rows have NULL values for new_* columns and populated old_* columns.
126118
This verifies the SQL is correctly setting NULL for the new version.
127119
"""
128-
result = session_fv2410_fv2504_with_diff_view.execute(
129-
text(
130-
"""
120+
result = session_fv2410_fv2504_with_diff_view.execute(text("""
131121
SELECT
132122
SUM(CASE WHEN new_segment_code IS NOT NULL THEN 1 ELSE 0 END) as new_segment_not_null,
133123
SUM(CASE WHEN new_line_ahb_status IS NOT NULL THEN 1 ELSE 0 END) as new_status_not_null,
@@ -136,9 +126,7 @@ def test_diff_view_deleted_rows_have_null_new_columns(session_fv2410_fv2504_with
136126
WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
137127
AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
138128
AND diff_status = 'deleted'
139-
"""
140-
)
141-
)
129+
"""))
142130
row = list(result)[0]
143131
assert row[0] == 0, "Deleted rows should have NULL new_segment_code"
144132
assert row[1] == 0, "Deleted rows should have NULL new_line_ahb_status"
@@ -150,18 +138,14 @@ def test_diff_view_modified_rows_have_actual_differences(session_fv2410_fv2504_w
150138
Test that 'modified' rows actually have differences in at least one compared field.
151139
This verifies the CASE statement logic is correct.
152140
"""
153-
result = session_fv2410_fv2504_with_diff_view.execute(
154-
text(
155-
"""
141+
result = session_fv2410_fv2504_with_diff_view.execute(text("""
156142
SELECT id_path, old_line_ahb_status, new_line_ahb_status,
157143
old_line_name, new_line_name, old_bedingung, new_bedingung
158144
FROM v_ahb_diff
159145
WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
160146
AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
161147
AND diff_status = 'modified'
162-
"""
163-
)
164-
)
148+
"""))
165149
for row in result:
166150
id_path, old_status, new_status, old_name, new_name, old_bed, new_bed = row
167151
# At least one of status, name, or bedingung must be different
@@ -175,15 +159,11 @@ def test_diff_view_nonexistent_pruefi_returns_empty(session_fv2410_fv2504_with_d
175159
"""
176160
Test that querying a non-existent prüfidentifikator returns empty results.
177161
"""
178-
result = session_fv2410_fv2504_with_diff_view.execute(
179-
text(
180-
"""
162+
result = session_fv2410_fv2504_with_diff_view.execute(text("""
181163
SELECT COUNT(*) FROM v_ahb_diff
182164
WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
183165
AND old_pruefidentifikator = '99999' AND new_pruefidentifikator = '99999'
184-
"""
185-
)
186-
)
166+
"""))
187167
count = list(result)[0][0]
188168
assert count == 0, "Non-existent prüfi should return no results"
189169

unittests/test_pydantic_features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_json_dump(model: Anwendungshandbuch | MessageImplementationGuide) -> No
3737
if isinstance(model, Anwendungshandbuch):
3838
root_model = RootModel[Anwendungshandbuch](model)
3939
elif isinstance(model, MessageImplementationGuide):
40-
root_model = RootModel[MessageImplementationGuide](model) # type:ignore[assignment]
40+
root_model = RootModel[MessageImplementationGuide](model) # type: ignore[assignment]
4141
else:
4242
raise ValueError(f"Unexpected type: {model}")
4343
json_dict = root_model.model_dump(mode="json")

0 commit comments

Comments
 (0)