Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect SDMX version #176

Open
SanderNielen opened this issue Apr 26, 2024 · 2 comments
Open

Detect SDMX version #176

SanderNielen opened this issue Apr 26, 2024 · 2 comments
Labels
needs-info Needs more info from the issuer to proceed

Comments

@SanderNielen
Copy link

The eurostat API URL has a structure of /sdmx/2.1/. This is not recognized by the current script.

Suggested change in sdmx/reader/xml/__init__.py:
Line 34: if "v3_0" in url or "3.0" in url:
Line 37: elif "v2_1" in url or "2.1" in url:

@khaeru
Copy link
Owner

khaeru commented Apr 26, 2024

Hi @SanderNielen —thanks for your note.

In #158 (comment) I added ESTAT3, which speaks to Eurostat's SDMX 3.0.0 / SDMX-REST 2.1.0 endpoint, while ESTAT continues to query the base URL you mention, using SDMX-REST 1.5.0 and expecting responses in SDMX-ML 2.1. You can confirm this by looking at sources.json. Both also appear in the docs (though perhaps there could be more detail here), and are tested.

So your comment “not recognized by the current script” is, unfortunately, not precise enough to determine what kind of issue you're having. Can you please provide a minimal working example that demonstrates whatever error or unexpected outcome, and the full detail of that error message, traceback, etc.?

@khaeru khaeru added the needs-info Needs more info from the issuer to proceed label Apr 26, 2024
@SanderNielen
Copy link
Author

Do you mean I should just use sdmx.Client("ESTAT3")?

The code that produces the error is:

estat = sdmx.Client("ESTAT")
dataflows = estat.dataflow().dataflow
data_msg = estat.data("LFSO_05REGCP") # Example of a dataset code

The error traceback from sdmx1 version 2.14.0 is:

File "C:\***\sdmx\client.py", line 496, in get
  msg = reader.read_message(response_content, structure=kwargs.get("dsd", None))

File "C:\***\sdmx\reader\xml\__init__.py", line 40, in read_message
  assert version, f"Cannot determine SDMX-ML version of url"

(Note: this also happens when the requested table is too large.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Needs more info from the issuer to proceed
Projects
None yet
Development

No branches or pull requests

2 participants