Repository navigation
fix: improve metadata group discovery and loading - #348
Conversation
|
Hi, We have finished working on Issue #232. We made some changes to improve how the metadata groups are found and loaded, including the SIA BI metadata. We also added tests for the changes and made sure the SINAN saude groups are only used with SINAN. We ran the metadata tests and got 17 passed with 1 warning. Please have a look at the changes and let us know if anything needs to be changed. Thank you. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #348 +/- ##
=======================================
Coverage ? 97.21%
=======================================
Files ? 180
Lines ? 22685
Branches ? 0
=======================================
Hits ? 22053
Misses ? 632
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in version 2.11.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
- Fix trailing/extra blank lines and comment indentation in `pysus/api/metadata/columns.py` (pre-existing whitespace from AlertaDengue#348) - Wrap long endpoint strings in `pysus/api/saude/databases.py` to satisfy flake8 E501 while keeping values identical and ISC004 clean. Also validates with black 24.2.
* chore(python): support CPython 3.14 The cap on the interpreter was the only thing keeping 3.14 out. No application code changes are needed: the suite passes unchanged on 3.14.7 with the locked dependency versions (1780 passed, 6 skipped), and the tree uses nothing that has been removed since 3.11 -- no distutils, pkg_resources, imp, utcnow(), or bare get_event_loop(). Two dev tools did need fixing, both for the same reason: they touch ast.Str, which no longer exists on 3.12+. black 22.12 (what the `^22.6.0` dev pin resolved to) aborts with "cannot format: module 'ast' has no attribute 'Str'" on five files, and flake8-implicit-str-concat 0.4.0 takes down the whole flake8 run from its multiprocessing pool. The latter is the pre-commit hook CI actually runs, so a 3.14 matrix entry would have gone red at the Linting step before reaching the tests. flake8-implicit-str-concat is capped at >=0.6.0, the first release that works on 3.14. 0.7.0 would also run, but it adds an ISC004 check that flags eight existing implicit concatenations in saude/databases.py, which is out of scope here. The lock moves only black, flake8, pycodestyle and pyflakes. Every runtime dependency keeps its resolved version; numpy already carried a python_version == "3.11" split and needs no new marker. * fix(lint): pin flake8-implicit-str-concat exactly at 0.6.0 The previous commit used `>=0.6.0`, which resolves to 0.7.0. That version works on 3.14 too, but it adds an ISC004 check that flags eight existing implicit concatenations in api/saude/databases.py. Confirmed by running the lint under 3.11, 3.12, 3.13 and 3.14. Pin it exactly, matching the style of every other plugin in this file, so the lint result cannot shift underneath us the next time pre-commit autoupdate runs. 0.6.0 is the oldest release that does not crash on 3.14, and it reports no findings the newer ones would flag. * style: clean lint on metadata columns and saude databases - Fix trailing/extra blank lines and comment indentation in `pysus/api/metadata/columns.py` (pre-existing whitespace from #348) - Wrap long endpoint strings in `pysus/api/saude/databases.py` to satisfy flake8 E501 while keeping values identical and ISC004 clean. Also validates with black 24.2. * chore(lint): bump flake8-implicit-str-concat to 0.7.0 ISC004 findings were resolved (endpoint strings wrapped to avoid implicit concatenation in collections or made single-line as needed), so we can adopt 0.7.0 without new warnings. * fix(lint): resolve ISC004 in ECONOMIASAUDE endpoint strings * style: fix ISC001 in test_dadosgov
Summary
This pull request addresses Issue #232 by improving how PySUS discovers and loads metadata groups for online databases.
Changes
available_groups()to discover metadata groups from YAML keys.saudemetadata groups from being incorrectly listed for other databases.Testing
The metadata test suite was run successfully:
excludeis an unknown pytest config option)Team Contributions
Related to #232.