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

Minor: improve the Deprecation / API health guidelines #13701

Merged
merged 8 commits into from
Dec 13, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 9, 2024

Which issue does this PR close?

Rationale for this change

While discussing #13037 (comment) with @buraksenn I felt the API deprecation policy could be improved to provide more background and rationale

What changes are included in this PR?

  1. Update deprecation / API health policy to be claerer

Are these changes tested?

CI

Are there any user-facing changes?

I my opinion, this PR does not change the policy, it simply makes the current policy clearer

@alamb alamb changed the title Alamb/clarify deprecation Minor: improve the Deprecation / API health policy Dec 9, 2024
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 9, 2024
Copy link
Member

@jonahgao jonahgao left a comment

Choose a reason for hiding this comment

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

LGTM except for a minor typo

docs/source/library-user-guide/api-health.md Outdated Show resolved Hide resolved
Comment on lines +33 to +34
Breaking public API changes are those that _require_ users to change their code
for it to compile, and are listed as "Major Changes" in the [SemVer
Copy link
Member

Choose a reason for hiding this comment

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

Not "to compile" but rather "to compile and execute"

for example replacing the function body with a todo!() is also a breaking change, even though it does not affect the compile time.
See #13525 (comment) -- we should not motivate people to avoid compile-time breakages as this may come at the cost of harder to find runtime-breakages (as witnessed in #13708 (comment))

Copy link
Member

Choose a reason for hiding this comment

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

bump

docs/source/library-user-guide/api-health.md Outdated Show resolved Hide resolved
When deprecating a method:

- clearly mark the API as deprecated and specify the exact DataFusion version in which it was deprecated.
- concisely describe the preferred API, if relevant
- Mark the API as deprecated using `#[deprecated]` and specify the exact DataFusion version in which it was deprecated
Copy link
Member

Choose a reason for hiding this comment

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

Make it more copy-paste friendly

#[deprecated(since = "...",  note = "...")]

this may be important given that there is no static check which would flag #[deprecated] without since attribute and those sometimes make to the main branch (apache/arrow-rs#6782)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

Choose a reason for hiding this comment

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

(opt)

Suggested change
- Mark the API as deprecated using `#[deprecated]` and specify the exact DataFusion version in which it was deprecated
- Mark the API as deprecated using `#[deprecated(since="...", note="..."]` and specify the exact DataFusion version in which it was deprecated

(then you don't need the code block below)

@alamb alamb changed the title Minor: improve the Deprecation / API health policy Minor: improve the Deprecation / API health guidelines Dec 13, 2024
@alamb
Copy link
Contributor Author

alamb commented Dec 13, 2024

I am merging this PR in and we can iterate / improve the wording more going forward in future PRs

Thank you @findepi and @jonahgao for the reviews

@alamb alamb merged commit 8b6daaf into apache:main Dec 13, 2024
6 checks passed
@alamb alamb deleted the alamb/clarify_deprecation branch December 13, 2024 18:18
@findepi
Copy link
Member

findepi commented Dec 13, 2024

@alamb thanks for improving this!
can you PTAL #13701 (comment) ?

@alamb
Copy link
Contributor Author

alamb commented Dec 14, 2024

@alamb thanks for improving this! can you PTAL #13701 (comment) ?

Sorry about missing that @findepi. I made another PR to address it

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

Successfully merging this pull request may close these issues.

3 participants