-
Notifications
You must be signed in to change notification settings - Fork 794
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
Deprecation/breaking changes policy & process #3454
Comments
Thanks for opening the issue! This has definitely been an issue a few times already. The pandas policy you linked to sounds well thought out to me. We could just take that one? The polars policy as well but I'd prefer if we lean towards something shorter, especially to start out with. So far, major versions in Altair coincided with major versions in Vega-Lite. I think it would also be ok to break with this. Sure, whenever there is a major version release in VL, we probably need one in Altair as well as it might include breaking changes, but we could also think about doing a version 6 at one point with VL still being at 5 and the breaking changes would then only be about API stuff on the Altair side. Regarding cleaning up the public API, #2918 is related to this. I'm not sure how much of the API we can change, even in a major release, without making the costs for users too high. But i think it's worth exploring if we can move some lesser-used features of Altair to submodules and not import them up all the way to the top-level package namespace. It would help with docs, autocompletion, and just the general user experience. |
Thanks for linking that issue @binste, I hadn't seen it before
I think the
I agree with not tying major versions to upstream.
Besides maintaining the status quo of major versions aligning with altair/altair/vegalite/v5/api.py Lines 448 to 482 in 7f05ecb
The above is proposed only as a solution for maintaining major versions with
Other related |
Thanks for the ping!
The main pandas vs Polars difference that I'm aware of is about when deprecations are enforced. Suppose a deprecation is introduced in version 10.1. Then:
Having said that, the amount of time between major releases is expected to be lower for Polars |
Thanks for the clarification @MarcoGorelli, I've updated the description. From the version tagging I've done in #3455, the only non |
@binste this is a recent example from from typing import Any
import polars._typing as plt
from polars._utils.deprecation import issue_deprecation_warning
def __getattr__(name: str) -> Any:
if name in dir(plt):
issue_deprecation_warning(
"The `polars.type_aliases` module is deprecated."
" The type aliases have moved to the `polars._typing` module to explicitly mark them as private."
" Please define your own type aliases, or temporarily import from the `polars._typing` module."
" A public `polars.typing` module will be added in the future.",
version="1.0.0",
)
return getattr(plt, name)
msg = f"module {__name__!r} has no attribute {name!r}"
raise AttributeError(msg) AFAIK, when combined with explicit imports on the top level - this would also solve #2927 Existing code would continue to work (w/ a deprecation warning) but autocomplete wouldn't display those that are only accessible via the |
Interesting proposal! The more I think about this, the more I see the value in sticking with semantic versioning as it's convenient to use in version restrictions and it's what users know from many other packages. I think this also means that we should not tie VL and Altair major versions together to be more flexible with evolving the API. Most users are probably not aware what Vega-Lite is and don't have to be and so there is no value in it for them to have major versions in sync. Let's see if anyone else wants to weigh in here. If you want to draft a short policy for the docs section, that's of course very much appreciated and we could also continue the conversation in that PR. |
While I think there is some convenience with having the Altair and Vega-Lite versions match up, I agree that the advantages of sticking to semantic versioning and releasing breaking changes in Altair when they are ready are probably bigger benefits, so I'm also OK with breaking the VL version mapping.
Big +1 from me! |
Agree - for reference, Polars saw quite noticeable import time improvements from not loading less-used submodules upfront Side note on import times, which I hadn't noticed until this issue spurred me to check: since #3452, |
Thanks for all the input! @binste @joelostblom @MarcoGorelli
While it wasn't opened to directly address this issue, it is quite related, and I think a good initial boundary test of what everyone considers breaking. As mentioned in #3478 (comment) |
Based on discussions in vega#3454 (comment) and vega#3454 (comment) vega#3454
* docs: create `versioning.rst` placeholder * docs: add link to `roadmap.rst` * docs: Initial `versioning.rst` draft Based on discussions in #3454 (comment) and #3454 (comment) #3454 * docs: fix version number in italics * docs: add `Version numbers` heading * docs: add `Deprecation` section * docs: Clarify upstream breaking -> warning option #3488 (comment) * docs: add undoc statement #3488 (comment) * docs: Clearly define **Public API** Intentionally simple, see linked thread for discussion #3478 (comment) * docs: Tweak formatting of deprecation section
Note
This issue is focused on how future changes are made and how they are communicated both on release and at runtime.
Any specific reference is used only as an example.
Motivation
I've been thinking about this since #3426, which dealt with removing a 4-year old deprecation, but there are some other cases where it could have been helpful:
Chart|LayerChart.encode
, 1.32x speedup toinfer_encoding_types
#3444 (comment)alt.utils.core.infer_encoding_types
ChartType
type and type guardis_chart_type
. Change PurePath to Path type hints #3420 (comment)alt.utils.save.write_file_or_filename
api.py
#3480 (comment)_wrapper_classes
argument inSchemaBase.from_dict
mypy==1.11.0
issues inplugin_registry
#3487plugin_type
argument inPluginRegistry
I believe this would benefit both users and contributors:
Open Questions
There are likely many topics that could be discussed, but to get the ball rolling:
PRs
@deprecated
versioning, IDE highlighting #3455I have a draftPR merged with someideas onchanges thatcouldsupport versioning & static typingcouldwill be informed at import timeExamples from other projects
polars
pandas
polars
,I think the stance is pretty much the same but using fewer wordsThe text was updated successfully, but these errors were encountered: