-
Notifications
You must be signed in to change notification settings - Fork 23
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
Error in cpi.update() #74
Comments
Hmm. If that response isn't "ok" I'm guessing something failed in the download, yes? Is it possible your internet went out? does this problem consistently persist? If so, maybe the BLS changed the URL we are downloading from? |
Looks like we are getting blocked from downloading by bot detection added to the BLS website.
|
I've attempted to patch this bug, and better test for its future recurrence. Please upgrade to version 1.0.18 and try again. Assuming it's fixed, I'll close this ticket. If you still have the problem, please speak up. |
Hi Ben, It has fixed the issue. I am able to run "cpi.update()" with the latest version (1.0.18). Thank you so much. |
That's great news. I'm glad to hear it.
…On Fri, Apr 14, 2023, at 1:16 PM, Tushar Singh Soam wrote:
Hi Ben,
It has fixed the issue. I am able to run "cpi.update()" with the latest version (1.0.18). Thank you so much.
—
Reply to this email directly, view it on GitHub <#74 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAACOCL6UP3PBAJ63Y75IH3XBGWCVANCNFSM6AAAAAAW6NIYL4>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Following is the traceback for the issue I faced during cpi.update():
Version of cpi used: 1.0.17
AssertionError Traceback (most recent call last)
Cell In [40], line 1
----> 1 cpi.update()
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cpi_init_.py:163, in update()
157 def update():
158 """
159 Updates the Consumer Price Index dataset at the core of this library.
160
161 Requires an Internet connection.
162 """
--> 163 Downloader().update()
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cpi\download.py:75, in Downloader.update(self)
73 # Download the TSVs
74 logger.debug(f"Downloading {len(self.FILE_LIST)} files from the BLS")
---> 75 [self.get_tsv(file) for file in self.FILE_LIST]
77 # Insert the TSVs
78 logger.debug("Loading data into SQLite database")
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cpi\download.py:75, in (.0)
73 # Download the TSVs
74 logger.debug(f"Downloading {len(self.FILE_LIST)} files from the BLS")
---> 75 [self.get_tsv(file) for file in self.FILE_LIST]
77 # Insert the TSVs
78 logger.debug("Loading data into SQLite database")
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\cpi\download.py:109, in Downloader.get_tsv(self, file)
107 tsv_path = self.get_data_dir() / f"{file}.tsv"
108 response = requests.get(url)
--> 109 assert response.ok
110 with open(tsv_path, "w") as fp:
111 fp.write(response.text)
AssertionError:
The text was updated successfully, but these errors were encountered: