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

Martinique / MTQ is missing from wbdata #64

Closed
Bojangels opened this issue Oct 27, 2020 · 2 comments
Closed

Martinique / MTQ is missing from wbdata #64

Bojangels opened this issue Oct 27, 2020 · 2 comments
Labels
upstream Problem is upstream, can't fix in library

Comments

@Bojangels
Copy link

A query using wbdata does not return data, despite it being available on the WB website. For example, compare:

https://databank.worldbank.org/reports.aspx?source=worldwide-governance-indicators#`

With the following script:

import wbdata

data_dates = (datetime.datetime(2019,1,1), datetime.datetime(2019,1,1))

MTQ_missing = wbdata.get_dataframe({'PV.EST':'values'},
country=('MTQ'), data_date=data_dates, convert_date=False, keep_levels=True)

Which returns:


IndexError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/fetcher.py in fetch(url, args, cache)
123 try:
--> 124 results.extend(response[1])
125 this_page = response[0]["page"]

IndexError: list index out of range

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
in
----> 1 MTQ_missing = wbdata.get_dataframe({'PV.EST':'values'},
2 country=('MTQ'), data_date=data_dates, convert_date=False, keep_levels=True)

</Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/decorator.py:decorator-gen-127> in get_dataframe(indicators, country, data_date, freq, source, convert_date, keep_levels, cache)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/api.py in uses_pandas(f, *args, **kwargs)
83 if not pd:
84 raise ValueError("Pandas must be installed to be used")
---> 85 return f(*args, **kwargs)
86
87

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/api.py in get_dataframe(indicators, country, data_date, freq, source, convert_date, keep_levels, cache)
480 :returns: a WBDataFrame
481 """
--> 482 serieses = [
483 (
484 get_series(

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/api.py in (.0)
482 serieses = [
483 (
--> 484 get_series(
485 indicator=indicator,
486 country=country,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/api.py in get_series(indicator, country, data_date, freq, source, convert_date, column_name, keep_levels, cache)
184 :returns: WBSeries
185 """
--> 186 raw_data = get_data(
187 indicator=indicator,
188 country=country,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/api.py in get_data(indicator, country, data_date, freq, source, convert_date, pandas, column_name, keep_levels, cache)
287 if source:
288 args["source"] = source
--> 289 data = fetcher.fetch(query_url, args, cache=cache)
290 if convert_date:
291 data = convert_dates_to_datetime(data)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wbdata/fetcher.py in fetch(url, args, cache)
128 try:
129 message = response[0]["message"][0]
--> 130 raise RuntimeError(
131 f"Got error {message['id']} ({message['key']}): "
132 f"{message['value']}"

RuntimeError: Got error 120 (Invalid value): The provided parameter value is not valid

@OliverSherouse OliverSherouse added the upstream Problem is upstream, can't fix in library label Oct 27, 2020
@OliverSherouse
Copy link
Owner

This is apparently an error upstream. http://api.worldbank.org/v2/country/MTQ gives the same error. Unfortunately, that means I can't do anything about it.

@Bojangels
Copy link
Author

Bojangels commented Oct 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Problem is upstream, can't fix in library
Projects
None yet
Development

No branches or pull requests

2 participants