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

Commit 1d06fe5

Browse files
author
sergeiQ
authored
add support for 'code' column in datatables (#87)
1 parent f03b21f commit 1d06fe5

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
/quandl.egg-info
66
/build
77
/dist
8-
/tmp/
8+
/tmp/
9+
.idea/*
10+
venv

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 3.1.0 - 2017-03-07
2+
3+
* Bug: support column with a name 'code'
4+
5+
16
### 3.0.1 - 2016-05-25
27

38
* Handle unexpected errors

quandl/get_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77

88

9-
def get_table(code, **options):
9+
def get_table(datatable_code, **options):
1010
if 'paginate' in options.keys():
1111
paginate = options.pop('paginate')
1212
else:
@@ -16,7 +16,7 @@ def get_table(code, **options):
1616
page_count = 0
1717
while True:
1818
next_options = copy.deepcopy(options)
19-
next_data = Datatable(code).data(params=next_options)
19+
next_data = Datatable(datatable_code).data(params=next_options)
2020

2121
if data is None:
2222
data = next_data

quandl/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '3.0.1'
1+
VERSION = '3.1.0'

test/test_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ def test_build_request(self, mock):
6767
'accept': ('application/json, '
6868
'application/vnd.quandl+json;version=2015-04-09'),
6969
'request-source': 'python',
70-
'request-source-version': '3.0.1'},
70+
'request-source-version': '3.1.0'},
7171
params={'per_page': 10, 'page': 2})
7272
self.assertEqual(mock.call_args, expected)

test/test_get_table.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,8 @@ def tearDownClass(cls):
3737
def test_datatable_returns_datatable_object(self, mock):
3838
df = quandl.get_table('ZACKS/FC', params={})
3939
self.assertIsInstance(df, pandas.core.frame.DataFrame)
40+
41+
@patch('quandl.connection.Connection.request')
42+
def test_datatable_with_code_returns_datatable_object(self, mock):
43+
df = quandl.get_table('AR/MWCF', code="ICEP_WAC_Z2017_S")
44+
self.assertIsInstance(df, pandas.core.frame.DataFrame)

0 commit comments

Comments
 (0)