Skip to content
This repository has been archived by the owner on Apr 30, 2022. It is now read-only.

Commit

Permalink
update the data size exceeded message (#95)
Browse files Browse the repository at this point in the history
* update the data size exceeded message

* fix style issues

* update test

* change email to connect
  • Loading branch information
A-Scott-Rowe authored Nov 2, 2017
1 parent bacbc58 commit 233bb63
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 12 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
### 3.2.1 - 2017-10-23

* Provide a more actionable warning when asking for data over 1M rows

### 3.2.0 - 2017-06-14

* Add test support for python 3.6.

* Raise error when over 1000000 rows when fetching tables with paginate

* Pandas fix for newer pandas version.

* Bug fixes

### 3.1.0 - 2017-03-07

* Bug: support column with a name 'code'


### 3.0.1 - 2016-05-25

* Handle unexpected errors
Expand All @@ -12,4 +25,4 @@
* Datatables for developers
* Datatables for analysts
* Backwards compatibility
* Documentation updates
* Documentation updates
6 changes: 5 additions & 1 deletion quandl/get_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def get_table(datatable_code, **options):
data.extend(next_data)

if page_count >= ApiConfig.page_limit:
raise LimitExceededError(Message.WARN_DATA_LIMIT_EXCEEDED)
raise LimitExceededError(
Message.WARN_DATA_LIMIT_EXCEEDED % (datatable_code,
ApiConfig.api_key
)
)

next_cursor_id = next_data.meta['next_cursor_id']

Expand Down
8 changes: 5 additions & 3 deletions quandl/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ class Message:
minimum index is 1 and the maximum index is %s'
ERROR_REQUESTED_COLUMN_NOT_EXIST = 'Requested column index %s does not exist'

WARN_DATA_LIMIT_EXCEEDED = 'This call returns a larger amount of data than quandl.get_table() \
allows. Please view our documentation on developer methods to request more data. \
https://github.com/quandl/quandl-python/blob/master/FOR_ANALYSTS.md#things-to-note'
WARN_DATA_LIMIT_EXCEEDED = 'This call exceeds the amount of data that quandl.get_table() allows. \
Please use the following link in your browser, which will download the full results as \
a CSV file: https://www.quandl.com/api/v3/datatables/%s?qopts.export=true&api_key=%s. See \
our API documentation for more info: \
https://docs.quandl.com/docs/in-depth-usage-1#section-download-an-entire-table'
WARN_PAGE_LIMIT_EXCEEDED = 'To request more pages, please set paginate=true in your \
quandl.get_table() call. For more information see our documentation: \
https://github.com/quandl/quandl-python/blob/master/FOR_ANALYSTS.md#things-to-note'
Expand Down
3 changes: 1 addition & 2 deletions quandl/model/model_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def __init__(self, klass, values, meta):
self.meta = meta

def to_list(self):
l = list([x.to_list() for x in self.values])
return l
return list([x.to_list() for x in self.values])

def __getattr__(self, k):
if k in self.meta:
Expand Down
2 changes: 1 addition & 1 deletion quandl/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '3.2.0'
VERSION = '3.2.1'
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
long_description=long_description,
version=VERSION,
author='Quandl',
author_email='[email protected]',
maintainer='Quandl Development Team',
maintainer_email='dev@quandl.com',
maintainer_email='connect@quandl.com',
url='https://github.com/quandl/quandl-python',
license='MIT',
install_requires=install_requires,
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/my_httpretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from requests.packages.urllib3.contrib.pyopenssl \
import inject_into_urllib3, extract_from_urllib3
pyopenssl_override = True
except:
except: # noqa: E722
pyopenssl_override = False


Expand Down
2 changes: 1 addition & 1 deletion test/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ def test_build_request(self, mock):
'accept': ('application/json, '
'application/vnd.quandl+json;version=2015-04-09'),
'request-source': 'python',
'request-source-version': '3.2.0'},
'request-source-version': '3.2.1'},
params={'per_page': 10, 'page': 2})
self.assertEqual(mock.call_args, expected)

0 comments on commit 233bb63

Please sign in to comment.