Skip to content

DOC: GH3105 better error message on ndarray construction #3131

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

Merged
merged 1 commit into from
Mar 25, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Mar 21, 2013

closes #3105

@hayd
Copy link
Contributor

hayd commented Mar 25, 2013

I never liked that error message, will be glad to see it die.

Most likely I am missing something, but are these tests asserting anything? Should each test include something similar to:

self.assert_(detail.message.startswith("Shape of passed values"))

.

(I'm afraid I can't help mentioning):

tuple([len(index),len(columns)]) == (len(index),len(columns))

@jreback
Copy link
Contributor Author

jreback commented Mar 25, 2013

yah...prob should be asserting....

what' s the 2nd part of your message?

@hayd
Copy link
Contributor

hayd commented Mar 25, 2013

Looks like python3 doesn't give .message attribute to ValueError... hmmm.

Second part is simply that: required_shape = tuple([len(index),len(columns)]) could read required_shape = (len(index),len(columns)) :)

@ghost
Copy link

ghost commented Mar 25, 2013

try:
    raise ValueError("foo")
except (Exception), detail:
    assert(str(detail).startswith("foo"))

@jreback
Copy link
Contributor Author

jreback commented Mar 25, 2013

@y-p @hayd thanks....just figured that out!

also was missing some cases, so did a bit of refactoring to make it consistent

@jreback
Copy link
Contributor Author

jreback commented Mar 25, 2013

@hayd Andy on a side note, you are very patient with people on stackoverflow!

@hayd
Copy link
Contributor

hayd commented Mar 25, 2013

@jreback Thanks! I try not to think about it... :)

@jreback
Copy link
Contributor Author

jreback commented Mar 25, 2013

anymore comments on this....merging soon...

@ghost
Copy link

ghost commented Mar 25, 2013

looks fine to me.

CLN: refactor to put all block manager creation calls into internals.py
     so to wrap with invalid constructions
TST: now py3 compatible
jreback added a commit that referenced this pull request Mar 25, 2013
DOC: GH3105 better error message on ndarray construction
@jreback jreback merged commit e6140e9 into pandas-dev:master Mar 25, 2013
@hayd
Copy link
Contributor

hayd commented Jun 16, 2013

@jreback I have only just looked at the google groups page... right back at you!

@jreback
Copy link
Contributor Author

jreback commented Jun 16, 2013

TOTD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame constructor error unhelpful
2 participants