Skip to content

BUG: dtype="int64[pyarrow]foobar[pyarrow]" fails to raise #51225

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
jbrockmendel opened this issue Feb 8, 2023 · 0 comments · Fixed by #51548
Closed

BUG: dtype="int64[pyarrow]foobar[pyarrow]" fails to raise #51225

jbrockmendel opened this issue Feb 8, 2023 · 0 comments · Fixed by #51548
Labels
Arrow pyarrow functionality Bug

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Feb 8, 2023

pd.Series(range(3), dtype="int64[pyarrow]foobar[pyarrow]")

In ArrowDtype.construct_from_string we do

        if not string.endswith("[pyarrow]"):
            raise TypeError(f"'{string}' must end with '[pyarrow]'")
        if string == "string[pyarrow]":
            # Ensure Registry.find skips ArrowDtype to use StringDtype instead
            raise TypeError("string[pyarrow] should be constructed by StringDtype")
        base_type = string.split("[pyarrow]")[0]

But that does not rule out the case where there are multiple "[pyarrow]"s in the string. This should raise.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 8, 2023
@phofl phofl added Arrow pyarrow functionality and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants