Skip to content

TST: wb test failing #8768

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

Closed
jreback opened this issue Nov 10, 2014 · 6 comments
Closed

TST: wb test failing #8768

jreback opened this issue Nov 10, 2014 · 6 comments
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Nov 10, 2014

xref #8551

cc @jnmclarty

.SS.E
======================================================================
ERROR: test_wdi_search (pandas.io.tests.test_wb.TestWB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jreback/pandas/pandas/util/testing.py", line 1417, in wrapper
    return t(*args, **kwargs)
  File "/Users/jreback/pandas/pandas/io/tests/test_wb.py", line 25, in test_wdi_search
    result = search('gdp.*capita.*constant').loc[6716:,['id','name']]
  File "/Users/jreback/pandas/pandas/core/indexing.py", line 1200, in __getitem__
    return self._getitem_tuple(key)
  File "/Users/jreback/pandas/pandas/core/indexing.py", line 704, in _getitem_tuple
    self._has_valid_tuple(tup)
  File "/Users/jreback/pandas/pandas/core/indexing.py", line 131, in _has_valid_tuple
    if not self._has_valid_type(k, i):
  File "/Users/jreback/pandas/pandas/core/indexing.py", line 1260, in _has_valid_type
    (key.start, self.obj._get_axis_name(axis))
KeyError: 'start bound [6716] is not the [index]'

----------------------------------------------------------------------
Ran 5 tests in 14.969s
@jreback jreback added Testing pandas testing functions or related to the test suite Data Reader labels Nov 10, 2014
@jreback jreback added this to the 0.15.2 milestone Nov 10, 2014
@jnmclarty
Copy link
Contributor

Looking at this now.

@jnmclarty
Copy link
Contributor

The problem is that world bank's search results are not static.

it's now returning...

                      id                                               name
700   6.0.GDPpc_constant  GDP per capita, PPP (constant 2011 internation...
4682             GDPPCKD             GDP per Capita, constant US$, millions
6717      NY.GDP.PCAP.KD                 GDP per capita (constant 2005 US$)
6719      NY.GDP.PCAP.KN                      GDP per capita (constant LCU)
6721   NY.GDP.PCAP.PP.KD  GDP per capita, PPP (constant 2011 internation...

...so the test fails.

It's a poorly designed test. FWIW, I updated the test in my last commit, but wasn't the original creator/designer of it.

A reasonable check, would be to make sure the contents of the 'name' column contain, say, at least 1 element with 'GDP' in it. I'll can do a PR momentarily.

@jreback
Copy link
Contributor Author

jreback commented Nov 10, 2014

maybe just assert that u can at least 1 row back

jnmclarty added a commit to jnmclarty/pandas that referenced this issue Nov 10, 2014
@jnmclarty
Copy link
Contributor

Already had this done, before I saw your comment.

@jnmclarty
Copy link
Contributor

I'm crashing for the night. That's ready to be merged, and is actually an improved test - and in fewer lines!

jreback pushed a commit that referenced this issue Nov 10, 2014
@jreback
Copy link
Contributor Author

jreback commented Nov 10, 2014

closed by #8769

@jreback jreback closed this as completed Nov 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants