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

rename to_arrow, as_arrow #2964

Open
andrewgazelka opened this issue Sep 27, 2024 · 1 comment
Open

rename to_arrow, as_arrow #2964

andrewgazelka opened this issue Sep 27, 2024 · 1 comment

Comments

@andrewgazelka
Copy link
Member

andrewgazelka commented Sep 27, 2024

In the codebase, we have two methods: to_arrow and as_arrow. These can be potentially confusing due to uncertainty regarding when to use each one. It would be useful to add documentation or perhaps even unify the methods or create a new method that returns a Cow.

The reason for this is that to_arrow performs an allocation, whereas as_arrow returns a reference. Sometimes, you don't actually need to do the allocation. If you return a Cow, it can either avoid allocation by returning Cow::Borrowed, or perform an allocation when necessary and return Cow::Owned.

@universalmind303
Copy link
Collaborator

there are lots of to_arrow methods in the codebase, can you provide more info on which ones you are suggesting changing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants