khaeru / sdmx

SDMX information model and client in Python
https://sdmx1.readthedocs.io
Apache License 2.0
24 stars 18 forks source link

Use supplied DSD for structure-specific messages #147

Closed khaeru closed 10 months ago

khaeru commented 10 months ago

135 updated this line:

https://github.com/khaeru/sdmx/blob/c28f50af506db86da6a35b7df13d8739362eb0df/sdmx/reader/xml/v21.py#L683 …to refer to BaseDataStructureDefinition, the base class for {v21,v30}.DataStructureDefinition.

However, Reader.get_single() does not match on subclasses unless subclass=True is given explicitly. The method would thus always return None, resulting in a warning, also perhaps other failures to use the provided DSD wherever code refers to the ss_without_dsd variable.

This PR corrects, closing #146.

PR checklist

codecov[bot] commented 10 months ago

Codecov Report

Merging #147 (e5c358a) into main (c28f50a) will decrease coverage by 2.41%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #147 +/- ## ========================================== - Coverage 98.33% 95.93% -2.41% ========================================== Files 87 87 Lines 6440 6443 +3 ========================================== - Hits 6333 6181 -152 - Misses 107 262 +155 ``` | [Files](https://app.codecov.io/gh/khaeru/sdmx/pull/147?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto) | Coverage Δ | | |---|---|---| | [sdmx/reader/xml/v21.py](https://app.codecov.io/gh/khaeru/sdmx/pull/147?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-c2RteC9yZWFkZXIveG1sL3YyMS5weQ==) | `97.69% <ø> (-0.13%)` | :arrow_down: | | [sdmx/tests/test\_dataset\_ss.py](https://app.codecov.io/gh/khaeru/sdmx/pull/147?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-c2RteC90ZXN0cy90ZXN0X2RhdGFzZXRfc3MucHk=) | `100.00% <100.00%> (ø)` | | ... and [17 files with indirect coverage changes](https://app.codecov.io/gh/khaeru/sdmx/pull/147/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto)
khaeru commented 10 months ago

@miccoli, please let me know if you are able to test the fix on this branch. No problem if not; then I'll just merge and release.

miccoli commented 10 months ago

@miccoli, please let me know if you are able to test the fix on this branch. No problem if not; then I'll just merge and release.

Yes I can test this branch. I have no access to my testing machine right now, but should be able to do it evening (CET).

miccoli commented 10 months ago

:+1: My workflows are OK running sdmx from this branch. Thanks!