Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ jobs:
ci-passed:
runs-on: ubuntu-latest
needs: [ci-started, build-test-release, check-code-quality, reuse-compliance]
if: always()

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

publish:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

repos:
- repo: https://github.com/fsfe/reuse-tool
rev: v4.0.3
rev: v5.0.2
hooks:
- id: reuse
- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 6.0.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black-jupyter
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.16.0
hooks:
- id: mypy
additional_dependencies: [numpy, pandas]
Expand Down
3 changes: 3 additions & 0 deletions src/power_grid_model_io/converters/tabular_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ def _convert_col_def_to_attribute( # pylint: disable = too-many-arguments,too-m
"""
# To avoid mistakes, the attributes in the mapping should exist. There is one extra attribute called
# 'extra' in which extra information can be captured.
if pgm_data.dtype.names is None:
raise ValueError(f"pgm_data for '{component}s' has no attributes defined. (dtype.names is None)")

if attr not in pgm_data.dtype.names and attr not in ["extra", "filters"]:
attrs = ", ".join(pgm_data.dtype.names)
raise KeyError(f"Could not find attribute '{attr}' for '{component}s'. (choose from: {attrs})")
Expand Down
Loading