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

PERF: Improve conversion in read_csv when string option is set #56046

Merged
merged 4 commits into from
Nov 30, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Nov 18, 2023

  • 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.

cc @jbrockmendel

The finalise does the conversion, but this might make us roundtrip

@mroeschke mroeschke added the IO CSV read_csv, to_csv label Nov 26, 2023
@phofl
Copy link
Member Author

phofl commented Nov 29, 2023

Can we get this one in?

frame = table.to_pandas(types_mapper=arrow_string_types_mapper())

def types_mapper(dtype):
dtype_dict = self.kwds["dtype"]
Copy link
Member

Choose a reason for hiding this comment

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

Is dtype guaranteed to be in self.kwds at this point?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep

@phofl phofl added this to the 2.2 milestone Nov 30, 2023
@mroeschke mroeschke merged commit 4f080b8 into pandas-dev:main Nov 30, 2023
42 checks passed
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the csv_arrow_conversion branch November 30, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants