Hi @thomasbrand,
I hope you’re well!
I’ve been looking at this issue, but I still can’t figure it out…
So I extracted 3 examples that either work or don’t when retrieving data using Python API:
Working:
- Germany GDP: DESTATIS/81000BV007/DG.VGRPVK.X13JDKSB.VGR014
Not working:
- Spain GDP: INE-SPAIN/30679/72.b1gq.l.y.00.index
- US GDP: BEA/NIPA-T11706/A191RX-Q
I find that the issue with the not working series is in this method: fetch_series_by_api_link(api_link, max_nb_series=None, editor_api_base_url=default_editor_api_base_url, filters=None), lines 233-237, i.e. that’s where the code breaks for not working series.
If I look at ‘series_infos’ when trying to retrieve each of the series, I can see that in the case of Germany, ‘dimensions’ and ‘dimension_labels’ objects match, i.e.: there is a key equivalent in both the objects.:
‘dimensions’: {
‘DINSG’: ‘DG’,
‘VGRPB5’: ‘VGRPVK’,
‘WERT05’: ‘X13JDKSB’,
‘freq’: ‘Q’,
‘ind’: ‘VGR014’,
‘unit’: ‘jew_me’
}
‘dimensions_labels’: {
‘DINSG’: ‘Germany’,
‘VGRPB5’: ‘Price base (current prices / price-adjusted)’,
‘WERT05’: ‘Original and adjusted data’,
‘freq’: ‘Frequency’,
‘ind’: ‘Indicator’,
‘unit’: ‘Unit’
}
But when I look at Spain time series, I can see there are 2 additional key-value pairs in it’s dimension_labels object.:
‘dimensions’: {
‘3’: ‘72’,
‘482’: ‘b1gq’,
‘501’: ‘l’,
‘544’: ‘y’,
‘nac’: ‘00’,
‘units’: ‘index’
}
‘dimensions_labels’: {
‘3’: ‘Type of data’,
’481’: ‘DISTRIBUTION TRANSACTIONS’,
‘482’: ‘ACCOUNTING BALANCES’,
’495’: ‘GVA ACCOUNTING BALANCE’,
‘501’: ‘Prices_ESA’,
‘544’: ‘Correction of effects’,
‘nac’: ‘National Total’,
‘units’: ‘Units’
}
Similar thing happens with the US GDP:
‘dimensions’: {
‘FREQ’: ‘Q’,
‘concept’: ‘gross-domestic-product-gdp’,
‘metric’: ‘millions-of-chained-dollars’,
‘unit’: ‘level’
}
‘dimensions_labels’: {
‘FREQ’: ‘Frequency’,
‘concept’: ‘Concept’,
’industry’: ‘Industry’,
‘metric’: ‘Metric’,
’sub-industry’: ‘Industry precision’,
‘unit’: ‘Unit’
}
So because of these additional key-value pairs, the code breaks when it iterates over ‘dimensions_labels’ object and tries to find all key-values in the ‘dimensions’ object.
Unfortunatelly, I don’t know why in the case of Spain or the US these ‘dimensions’ and ‘dimensions_labels’ objects are different in terms of lenght.
There are many more time series like this, I was wondering if you guys are aware of this issue and or know the workaround?
Thank you!
Have a great day,
Aiste