Skip to content

Commit abf1d43

Browse files
benfrankelkhaeru
andauthored
Handle duplicate references args to Client.get() (#259, #260)
- Add test of #259 - Fix duplicate `references` - Add #259, #260 to doc/whatsnew --------- Co-authored-by: Paul Natsuo Kishimoto <[email protected]>
1 parent 5498d88 commit abf1d43

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

doc/whatsnew.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Next release
1414
with both :py:`version=...` and :py:`urn=...` would raise :class:`ValueError`
1515
even if the two were in agreement.
1616
- Fix two regressions in :func:`.to_pandas` introduced in v2.23.0 (:issue:`251`, :pull:`252`).
17+
- Fix a bug where supplying `references=...` to ESTAT or EMPL would raise :class:`ValueError` (thanks :gh-user:`benfrankel` for :issue:`259`, :pull:`260`).
1718

1819
v2.23.1 (2025-10-01)
1920
====================

sdmx/source/estat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def handle_references_param(kwargs: dict) -> None:
3636
kwargs.get("resource", None), "id", None
3737
)
3838
params = kwargs.setdefault("params", {})
39+
if "references" in kwargs:
40+
params["references"] = kwargs.pop("references")
3941

4042
# Preempt default values that would be set by Client._request_from_args()
4143
if not params.get("references"):

sdmx/tests/test_sources.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ class TestEMPL(DataSourceTest):
321321
"dataflow": dict(resource_id="LMP_IND_EXP"),
322322
}
323323

324+
def test_gh_259(self, client):
325+
"""Test of https://github.com/khaeru/sdmx/issues/259."""
326+
client.dataflow("LMP_EXPME", references="children")
327+
324328

325329
class TestGROW(DataSourceTest):
326330
source_id = "GROW"

0 commit comments

Comments
 (0)