BUG: Use the URL actually passed.

And move constants closer to where they're used.
This commit is contained in:
Scott Sanderson
2016-05-11 14:54:48 -04:00
parent 3a2c0e4ec8
commit 7dbabc013e
+7 -7
View File
@@ -304,12 +304,6 @@ def quandl_bundle(environ,
)
QUANTOPIAN_QUANDL_URL = (
'https://s3.amazonaws.com/quantopian-public-zipline-data/quandl'
)
ONE_MEGABYTE = 1024 * 1024
def download_with_progress(url, chunk_size, **progress_kwargs):
"""
Download streaming data from a URL, printing progress information to the
@@ -356,11 +350,17 @@ def download_without_progress(url):
data : BytesIO
A BytesIO containing the downloaded data.
"""
resp = requests.get(QUANTOPIAN_QUANDL_URL)
resp = requests.get(url)
resp.raise_for_status()
return BytesIO(resp.content)
QUANTOPIAN_QUANDL_URL = (
'https://s3.amazonaws.com/quantopian-public-zipline-data/quandl'
)
ONE_MEGABYTE = 1024 * 1024
@bundles.register('quantopian-quandl', create_writers=False)
def quantopian_quandl_bundle(environ,
asset_db_writer,