Skip to content

[ArrowStringArray] ENH: raise an ImportError when trying to create an arrow string dtype if pyarrow is not installed #41732

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
May 31, 2021

Conversation

simonjayhawkins
Copy link
Member

… arrow string dtype if pyarrow is not installed
@simonjayhawkins simonjayhawkins added the Strings String extension data type and string data label May 30, 2021
@simonjayhawkins simonjayhawkins added this to the 1.3 milestone May 30, 2021


@pytest.mark.skipif(
pa_version_under1p0,
reason="pyarrow>=1.0.0 is required for PyArrow backed StringArray",
Copy link
Member

Choose a reason for hiding this comment

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

should the numpy test still run?

Copy link
Member Author

Choose a reason for hiding this comment

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

self._dtype = ArrowStringDtype() is defined in __init__ before the input is checked. creating an instance ArrowStringDtype now raises an ImportError, tested in the test added.

Copy link
Member Author

Choose a reason for hiding this comment

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

actually we checked pyarrow was availble before with self._chk_pyarrow_available() but this module was skipped with pytest.importorskip("pyarrow", minversion="1.0.0")

@jreback
Copy link
Contributor

jreback commented May 31, 2021

this ok before #39908 ? @simonjayhawkins

@simonjayhawkins
Copy link
Member Author

this ok before #39908 ? @simonjayhawkins

either, conflicts either way. (just wanted to keep this change separate)

@jreback jreback merged commit 1b057ab into pandas-dev:master May 31, 2021
@jreback
Copy link
Contributor

jreback commented May 31, 2021

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the import-error branch May 31, 2021 17:25
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants