Skip to content

BUG: ArrowDtype.construct_from_string round-trip #50689

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 4 commits into from
Feb 18, 2023

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke
Copy link
Member

Might make sense to feature request this to Arrow to support parsing tz's in type_for_alias so we don't have to roll our own?

@jbrockmendel
Copy link
Member Author

Might make sense to feature request this to Arrow to support parsing tz's in type_for_alias so we don't have to roll our own?

I'll do that separately, sure.

@jbrockmendel
Copy link
Member Author

issue has been opened upstream + green

@jbrockmendel
Copy link
Member Author

@mroeschke gentle ping on pyarrow-xfail PRs

tail = tail[:-1]

if head == "timestamp":
if "," not in tail:
Copy link
Member

Choose a reason for hiding this comment

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

I don't think case needs handling

In [2]: pa.type_for_alias("timestamp[ns]")
Out[2]: TimestampType(timestamp[ns])

ArrowDtype.construct_from_string("timestamp[s, tz=UTC][pyarrow]")
ArrowDtype.construct_from_string("not_a_real_dype[s, tz=UTC][pyarrow]")

# but as of GH#50689, timestamptz is supported
Copy link
Member

Choose a reason for hiding this comment

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

In a follow up could you make this it's own test? (Nit: doesn't really fit the name of the test"

Copy link
Member Author

Choose a reason for hiding this comment

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

fair enough, will do

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM pending greenish

@mroeschke mroeschke added this to the 2.0 milestone Feb 18, 2023
@jbrockmendel
Copy link
Member Author

CI timeouts unrelated, merging.

@jbrockmendel jbrockmendel merged commit 450a1f0 into pandas-dev:main Feb 18, 2023
@jbrockmendel jbrockmendel deleted the enh-pa-dtype branch February 18, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants