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

Deprecate Fields::remove and Schema::remove #5144

Merged
merged 1 commit into from Nov 29, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

These were added in #4959 but in hindsight we should just direct users to SchemaBuilder. This keeps the API of Schema and Fields consistently immutable.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Nov 29, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

I think we should leave these APIs in place.

While they may be redundant, I think they are much easier to find initially for someone who just wants to remove a field

The mental overhead of figuring out that "I want to remove a field" to "so therefore I should make a builder, call remove, and then call build" I think is pretty high for casual users. I realize this is an opinion / judgement call

Perhaps instead of making this deprecated you can add a note to the documentation saying "You should use SchemaBuilder instead" and provide an example

@tustvold
Copy link
Contributor Author

tustvold commented Nov 29, 2023

If there were multiple such methods on Fields I might agree, but as it stands these methods just create confusion as it isn't immediately obvious that they aren't modifying in place.

There is a fairly prominent doc comment pointing people to SchemaBuilder already

https://docs.rs/arrow-schema/latest/arrow_schema/struct.Fields.html

@tustvold tustvold merged commit cfdb505 into apache:master Nov 29, 2023
26 checks passed
@alamb
Copy link
Contributor

alamb commented Nov 29, 2023

Here is the PR that aded the API in the first place: #4964

@alamb
Copy link
Contributor

alamb commented Nov 29, 2023

FYI @Folyd

@alamb
Copy link
Contributor

alamb commented Nov 29, 2023

If there were multiple such methods on Fields I might agree, but as it stands these methods just create confusion as it isn't immediately obvious that they aren't modifying in place.

There is a fairly prominent doc comment pointing people to SchemaBuilder already

https://docs.rs/arrow-schema/latest/arrow_schema/struct.Fields.html

I agree that looks like good enough documentation

@Folyd
Copy link
Contributor

Folyd commented Nov 29, 2023

Thanks for letting me know. @alamb ❤️

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

Successfully merging this pull request may close these issues.

None yet

4 participants