Skip to content

Commit 98d8025

Browse files
committed
FIX: annual frequency indicators which have another axis with an 'A' label
1 parent dbe3e79 commit 98d8025

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

larray_eurostat/tests/test_tsv.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ def test_eurostat_get_bad_dataset():
1818
def test_year_only_axes_as_int_and_not_object():
1919
data = eurostat_get('avia_ec_enterp')
2020
assert data.time.dtype.kind == 'i'
21+
22+
23+
# Check that annual frequency does not break when there is another axis with an 'A' label
24+
# https://github.com/larray-project/larray_eurostat/issues/34
25+
# An example of indicator with this problem is 'hsw_ph3_01'.
26+
# Keeping this test commented because the data is ~34Mb, so using it as a unit test
27+
# is probably not a good idea.
28+
# def test_annual_freq_with_other_a_label():
29+
# data = eurostat_get('hsw_ph3_01')
30+
# assert 'freq' not in data.axes
31+

larray_eurostat/tsv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _get_one(indicator, *, drop_markers=True):
5151

5252
# If only one frequency: subset and return without redundant freq Axis (compatibility old API)
5353
if len(la_data.freq) == 1:
54-
return la_data[la_data.freq.labels[0]]
54+
return la_data[la_data.freq.i[0]]
5555
else:
5656
return la_data
5757

0 commit comments

Comments
 (0)