wbdata icon indicating copy to clipboard operation
wbdata copied to clipboard

date kwarg does not seem to work for get_dataframe()

Open econstack opened this issue 4 months ago • 4 comments

Thank you for the update! After updating kwarg data_date to date for the get_dataframe() method, it does not seem to accept tuples as datetime objects or as strings. Both wbdata.get_dataframe({"NY.GDP.MKTP.CD": "value"}, date=["2000", "2022"]) and

start_year = datetime(2000, 1, 1)
end_year = datetime(2022, 1, 1)
df = wbdata.get_dataframe({"NY.GDP.MKTP.CD": "value"}, date=[start_year, end_year])

yield error TypeError: expected string or bytes-like object with additional error logging point to this line in the _parse_date method:

    if PATTERN_YEAR.fullmatch(date):

econstack avatar Feb 19 '24 15:02 econstack