Skip to content
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

[Arrow] Better error message for numpy.dtypepyarrow.DataType conversion exception #3836

Merged
merged 3 commits into from Sep 24, 2021

Conversation

kantuni
Copy link
Collaborator

@kantuni kantuni commented Sep 23, 2021

Closes #3709.

df.dtypes returns a pandas.Series of numpy.dtypes. There is a bug in Arrow which causes a conversion from numpy.dtype to pyarrow.DataType to fail. Thus, an error is thrown when trying to display df.dtypes.

The current workaround is to convert all cells to strings with df.dtypes.astype(str) until the issue is resolved.
This PR just makes the error message more readable.

Filed issue: https://issues.apache.org/jira/browse/ARROW-14087
PR Preview: https://share.streamlit.io/streamlit/core-previews/pr-3836.

@kantuni kantuni changed the title A better error message when using numpy.dtype [Arrow] A better error message for numpy.dtypepyarrow.DataType conversion exception Sep 23, 2021
@kantuni kantuni added package:arrow Related to Arrow and removed package:arrow Related to Arrow labels Sep 23, 2021
@kantuni kantuni changed the title [Arrow] A better error message for numpy.dtypepyarrow.DataType conversion exception [Arrow] Better error message for numpy.dtypepyarrow.DataType conversion exception Sep 24, 2021
@kantuni kantuni merged commit d004296 into streamlit:develop Sep 24, 2021
@kantuni kantuni deleted the fix/3709/numpy-dtype-arrow branch September 24, 2021 04:09
tconkling added a commit to tconkling/streamlit that referenced this pull request Oct 4, 2021
* develop:
  xmldom is no longer needed in resolutions (streamlit#3850)
  [Security] Upgrade css-what to 5.0.1 or later (streamlit#3852)
  Fixes streamlit#3866 (streamlit#3871)
  [Arrow] Better error message for `numpy.dtype` → `pyarrow.DataType` conversion exception (streamlit#3836)
  Remove attr dunder methods from internal SessionState (streamlit#3834)
Leonidas-Vitor added a commit to Leonidas-Vitor/AT_Projeto_Bloco_Streamlit that referenced this pull request Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:arrow Related to Arrow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

df.dtypes fails with Arrow
2 participants