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

Update test_doc_index1 #184

Merged
merged 1 commit into from
Jun 18, 2024
Merged
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
13 changes: 9 additions & 4 deletions sdmx/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import re
from typing import TYPE_CHECKING

import numpy as np
import pandas as pd
Expand All @@ -18,6 +19,9 @@
from sdmx.model.v21 import GenericDataSet
from sdmx.testing import assert_pd_equal

if TYPE_CHECKING:
import sdmx.message


@pytest.mark.network
def test_doc_example():
Expand Down Expand Up @@ -72,7 +76,7 @@ def test_doc_index1():
sm1 = sm0.dataflow.UNE_RT_A.structure(request=True, target_only=False)

# Same effect
sm1 = estat.get(
sm1: "sdmx.message.StructureMessage" = estat.get(
"datastructure",
sm0.dataflow.UNE_RT_A.structure.id,
params=dict(references="descendants"),
Expand Down Expand Up @@ -101,9 +105,10 @@ def test_doc_index1():
assert isinstance(s.codelist, DictLike)

# Same effect
# NB We use get() because, as of 2024-03-15, this query retrieves multiple versions
# of similar artefacts. This may need updating as ESTAT's versioning advances.
s = sdmx.to_pandas(sm1.get("ESTAT:GEO(17.0)"))
# NB At some times (e.g. between 2024-03-15 and 2024-06-18) this query retrieves
# multiple versions of similar artefacts. A more explicit argument to get() that
# includes the version (like get("GEO(21.0)")) may be temporarily needed.
s = sdmx.to_pandas(sm1.get("GEO"))
assert_pd_equal(s.sort_index().head(), expected)


Expand Down