Skip to content

Commit 21b8e75

Browse files
authored
Merge pull request #313 from PowerGridModel/feature/update-examples
Fix ci: github actions requires ci-passed + bump pre-commit + fix mypy
2 parents 889d44c + 00abdbb commit 21b8e75

File tree

5 files changed

+191
-53
lines changed

5 files changed

+191
-53
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ jobs:
5252
ci-passed:
5353
runs-on: ubuntu-latest
5454
needs: [ci-started, build-test-release, check-code-quality, reuse-compliance]
55+
if: always()
5556

5657
steps:
58+
# this explicit check is needed cfr. https://github.com/orgs/community/discussions/75568
59+
- name: "Check whether all jobs passed"
60+
run: echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")'
5761
- run: echo "ci passed"
5862

5963
publish:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
repos:
66
- repo: https://github.com/fsfe/reuse-tool
7-
rev: v4.0.3
7+
rev: v5.0.2
88
hooks:
99
- id: reuse
1010
- repo: https://github.com/pycqa/isort
11-
rev: 5.13.2
11+
rev: 6.0.1
1212
hooks:
1313
- id: isort
1414
- repo: https://github.com/psf/black
1515
rev: 25.1.0
1616
hooks:
1717
- id: black-jupyter
1818
- repo: https://github.com/pre-commit/mirrors-mypy
19-
rev: v1.11.2
19+
rev: v1.16.0
2020
hooks:
2121
- id: mypy
2222
additional_dependencies: [numpy, pandas]

src/power_grid_model_io/converters/tabular_converter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ def _convert_col_def_to_attribute( # pylint: disable = too-many-arguments,too-m
265265
"""
266266
# To avoid mistakes, the attributes in the mapping should exist. There is one extra attribute called
267267
# 'extra' in which extra information can be captured.
268+
if pgm_data.dtype.names is None:
269+
raise ValueError(f"pgm_data for '{component}s' has no attributes defined. (dtype.names is None)")
270+
268271
if attr not in pgm_data.dtype.names and attr not in ["extra", "filters"]:
269272
attrs = ", ".join(pgm_data.dtype.names)
270273
raise KeyError(f"Could not find attribute '{attr}' for '{component}s'. (choose from: {attrs})")

0 commit comments

Comments
 (0)