Skip to content

Commit 70b1ad4

Browse files
author
y-p
committed
Merge pull request #6008 from clarkfitzg/master (reworked)
* clarkfitzg-master: changed get_countries URL Added test for wb.get_countries
2 parents b537df5 + d2fce8b commit 70b1ad4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Improvements to existing features
102102

103103
Bug Fixes
104104
~~~~~~~~~
105+
- Bug in ``io.wb.get_countries`` not including all countries (:issue:`6008`)
105106
- Bug in Series replace with timestamp dict (:issue:`5797`)
106107
- read_csv/read_table now respects the `prefix` kwarg (:issue:`5732`).
107108
- Bug in selection with missing values via ``.ix`` from a duplicate indexed DataFrame failing (:issue:`5835`)

pandas/io/tests/test_wb.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
from pandas.util.testing import network
66
from pandas.util.testing import assert_frame_equal
77
from numpy.testing.decorators import slow
8-
from pandas.io.wb import search, download
8+
from pandas.io.wb import search, download, get_countries
99
import pandas.util.testing as tm
1010

11+
1112
class TestWB(tm.TestCase):
1213

1314
@slow
@@ -30,7 +31,6 @@ def test_wdi_search(self):
3031
expected.index = result.index
3132
assert_frame_equal(result, expected)
3233

33-
3434
@slow
3535
@network
3636
def test_wdi_download(self):
@@ -43,6 +43,12 @@ def test_wdi_download(self):
4343
expected.index = result.index
4444
assert_frame_equal(result, pandas.DataFrame(expected))
4545

46+
@slow
47+
@network
48+
def test_wdi_get_countries(self):
49+
result = get_countries()
50+
self.assertTrue('Zimbabwe' in list(result['name']))
51+
4652

4753
if __name__ == '__main__':
4854
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],

pandas/io/wb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _get_data(indicator="NY.GNS.ICTR.GN.ZS", country='US',
106106
def get_countries():
107107
'''Query information about countries
108108
'''
109-
url = 'http://api.worldbank.org/countries/all?format=json'
109+
url = 'http://api.worldbank.org/countries/?per_page=1000&format=json'
110110
with urlopen(url) as response:
111111
data = response.read()
112112
data = json.loads(data)[1]

0 commit comments

Comments
 (0)