Skip to content

BUG/API: Catch exceptions in _ipython_display_ #16132

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

Conversation

TomAugspurger
Copy link
Contributor

We raise an UnserializeableWarning when we fail to generate
the table schema and do not publish a table_schema repr.

closes #15996

We raise an UnserializeableWarning when we fail to generate
the table schema and do not publish a `table_schema` repr.
@TomAugspurger TomAugspurger added IO JSON read_json, to_json, json_normalize MultiIndex labels Apr 25, 2017
@TomAugspurger TomAugspurger added this to the 0.20.0 milestone Apr 25, 2017
@TomAugspurger
Copy link
Contributor Author

cc @rgbkrk so users get a pandas.errors.UnserializableWarning (open to better names here) if there's something we can't handle. The data published won't contain a application/vnd.dataresource+json key.

@codecov
Copy link

codecov bot commented Apr 25, 2017

Codecov Report

Merging #16132 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16132      +/-   ##
==========================================
- Coverage   90.86%   90.84%   -0.03%     
==========================================
  Files         159      159              
  Lines       50771    50777       +6     
==========================================
- Hits        46133    46126       -7     
- Misses       4638     4651      +13
Flag Coverage Δ
#multiple 88.62% <100%> (-0.03%) ⬇️
#single 40.33% <28.57%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/errors/__init__.py 100% <100%> (ø) ⬆️
pandas/core/generic.py 91.31% <100%> (+0.02%) ⬆️
pandas/plotting/_converter.py 63.54% <0%> (-1.82%) ⬇️
pandas/core/common.py 90.68% <0%> (-0.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d122e6...37c7ad0. Read the comment docs.

@rgbkrk
Copy link
Contributor

rgbkrk commented Apr 25, 2017

Looks good to me, this is completely appropriate behavior and informs the user as to what happened better than before. 👍

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm merge away

@TomAugspurger TomAugspurger merged commit d50b162 into pandas-dev:master Apr 25, 2017
@jorisvandenbossche
Copy link
Member

Small question: is it worth to add a special Warning for this (instead of using just UserWarning)?

In the sense that, if we intend to actually solve this issue in an upcoming release (certainly if we want this as the default repr this will be needed), then it is maybe not needed to add the special class (which we have to keep for compat afterwards).
If we foresee that we have to keep this warning for a longer time, then I am totally fine with it!

@TomAugspurger
Copy link
Contributor Author

Small question: is it worth to add a special Warning for this (instead of using just UserWarning)?

Yeah, I went back and forth on this. In the end I went with a special warning since we may always have some things that can't be represented with the spec (maybe), and it's a bit easier to filter just this warning if you want. I'm open to changing it to a builtin warning though.

@TomAugspurger TomAugspurger deleted the table_schema-fallback branch May 1, 2017 15:50
pcluo pushed a commit to pcluo/pandas that referenced this pull request May 22, 2017
We raise an UnserializeableWarning when we fail to generate
the table schema and do not publish a `table_schema` repr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO JSON read_json, to_json, json_normalize MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table Schema bombs with MultiIndex
4 participants