I'm running Ubuntu LTS 24.04 with Python 3.12.3. I'm unable to use this package as any operation after the initial creation of the cache fails. Here are the minimally reproducible steps to generate this error. All I'm doing is installing the package and then running the same query twice. The first time it succeeds. The second time it errors out. Note that I've made no attempt to debug this as I've never used this package before so I don't know what "working" would look like.
$ sudo apt install python3-venv
$ python3 -m venv test
$ source test/bin/activate
$ python3 -m pip install --upgrade pip
Requirement already satisfied: pip in ./test/lib/python3.12/site-packages (24.0)
Collecting pip
Using cached pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Using cached pip-24.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 24.0
Uninstalling pip-24.0:
Successfully uninstalled pip-24.0
Successfully installed pip-24.2
$ pip3 install beaapi-0.0.2-py3-none-any.whl
Processing beaapi-0.0.2-py3-none-any.whl
Collecting pandas>=1.5 (from beaapi==0.0.2)
Using cached pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)
Collecting numpy>=1.26.0 (from pandas>=1.5->beaapi==0.0.2)
Using cached numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Collecting python-dateutil>=2.8.2 (from pandas>=1.5->beaapi==0.0.2)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas>=1.5->beaapi==0.0.2)
Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas>=1.5->beaapi==0.0.2)
Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas>=1.5->beaapi==0.0.2)
Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Using cached pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.7 MB)
Using cached numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.0 MB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, tzdata, six, numpy, python-dateutil, pandas, beaapi
Successfully installed beaapi-0.0.2 numpy-2.1.0 pandas-2.2.2 python-dateutil-2.9.0.post0 pytz-2024.1 six-1.16.0 tzdata-2024.1
$ python3
>>> import beaapi
>>> BEA_API_KEY: str = "mykey"
>>> search_data = beaapi.search_metadata('Gross domestic', BEA_API_KEY)
Created directory: beaapi_data
Creating first-time local copy of metadata for all datasets - only done once in working directory.
Datasets will be updated only if timestamps indicate metadata obsolete in future searches, and only obsolete metadata sets will be updated.
>>> search_data = beaapi.search_metadata('Gross domestic', BEA_API_KEY)
venvs/test/lib/python3.12/site-packages/beaapi/search_metadata.py:143: UserWarning: API metadata mofication time table structure changed.
Check for package update
warnings.warn("API metadata mofication time table structure changed.\n"
Traceback (most recent call last):
search_data = beaapi.search_metadata('Gross domestic', BEA_API_KEY)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venvs/test/lib/python3.12/site-packages/beaapi/search_metadata.py", line 149, in search_metadata
lowerlocalmeta = [localmeta.lower() for localmeta in outdated_local_meta]
^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'outdated_local_meta' where it is not associated with a value
Please let me know if there's any additional info that I can provide that would be useful. Thanks
Hi,
I'm running Ubuntu LTS 24.04 with Python 3.12.3. I'm unable to use this package as any operation after the initial creation of the cache fails. Here are the minimally reproducible steps to generate this error. All I'm doing is installing the package and then running the same query twice. The first time it succeeds. The second time it errors out. Note that I've made no attempt to debug this as I've never used this package before so I don't know what "working" would look like.
Please let me know if there's any additional info that I can provide that would be useful. Thanks