Skip to content

Better error message if passed in a column name instead of a list of column names into custom_data #2177

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
chriddyp opened this issue Feb 10, 2020 · 4 comments · Fixed by #4083
Assignees
Milestone

Comments

@chriddyp
Copy link
Member

custom_data is unlike most other px properties in that it accepts a list of columns instead of just a single column.

It would be helpful if we said something like "Looks like you supplied a single column name, you should supply a list of columns."

Here's the current error:

ValueError: Value of 'custom_data_0' is not the name of a column in 'data_frame'. Expected one of ['uid', 'from_uid', 'dropout', 'embedding_size', 'epoch', 'lr', 'train f1', 'valid ppl'] but received: 19751736_1

@emmanuelle
Copy link
Contributor

Good idea. Same for hover_data and maybe a couple of others. We'll have to find a clever workaround though to see at which level to catch the error.

@emmanuelle emmanuelle added this to the v4.6.0 milestone Feb 11, 2020
@chriddyp
Copy link
Member Author

chriddyp commented Feb 11, 2020

It would also be helpful if we noted which attribute had an error. So, for the error message above, saying something like:

You supplied a single column name to the property custom_data. This property only accepts a list of column names. Try supplying custom_data=["your-column"] instead of custom_data="your-column"

@PandaTinker
Copy link

PandaTinker commented Feb 12, 2020

If we let the parser automatically convert "your-column" to ["your-column"], will there be any consequence?

@nicolaskruchten
Copy link
Contributor

nicolaskruchten commented Feb 19, 2020

I'd rather we provide a helpful error message for all the array_attrables if what's provided for them is not list-like :)

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