-
Notifications
You must be signed in to change notification settings - Fork 21
Add a way to retrieve the standard-compliant namespace, fill "how to adopt" and "future evolution" #156
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
Merged
Merged
Add a way to retrieve the standard-compliant namespace, fill "how to adopt" and "future evolution" #156
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _api-specification: | ||
|
||
API specification | ||
================= | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,63 @@ | ||
(future-API-evolution)= | ||
|
||
# Future API standard evolution | ||
|
||
## Scope extensions | ||
|
||
Proposals for scope extensions in a future version of the API standard will | ||
be proposed in an issue on the | ||
[data-apis/dataframe-api](https://github.com/data-apis/dataframe-api/issues) | ||
repository, and discussed in public and decided upon. | ||
|
||
```{note} | ||
In the future, once the API standard matures, this may be changed and follow | ||
the more formal process documented at | ||
[data-apis/governance::process_document.md](https://github.com/data-apis/governance/blob/main/process_document.md). | ||
``` | ||
|
||
|
||
## Backwards compatibility | ||
|
||
Functions, objects, keywords and specified behavior are added to this API | ||
standard only if there is a clear need, and functionality is either very | ||
minimally scoped or are already present in multiple existing dataframe | ||
libraries. Therefore it is highly unlikely that future versions of this | ||
standard will make backwards-incompatible changes. | ||
|
||
The aim is for future versions to be 100% backwards compatible with older | ||
versions. Any exceptions must have strong rationales and be clearly documented | ||
in the updated API specification and Changelog for a release. | ||
|
||
## Versioning | ||
|
||
(api-versioning)= | ||
|
||
## Versioning | ||
|
||
This API standard uses the following versioning scheme: | ||
|
||
- The version is date-based, in the form `yyyy.mm` (e.g., `2020.12`). | ||
- The version shall not include a standard way to do `alpha`/`beta`/`rc` or | ||
`.post`/`.dev` type versions. | ||
_Rationale: that's for Python packages, not for a standard._ | ||
- The version must be made available at runtime via an attribute | ||
`__dataframe_api_version__` by a compliant implementation, in `'yyyy.mm'` format | ||
as a string, in the namespace that implements the API standard. | ||
_Rationale: dunder version strings are the standard way of doing this._ | ||
|
||
No utilities for dealing with version comparisons need to be provided; given | ||
the format simple string comparisons with Python operators (`=-`, `<`, `>=`, | ||
etc.) will be enough. | ||
|
||
```{note} | ||
Rationale for the `yyyy.mm` versioning scheme choice: | ||
the API will be provided as part of a library, which already has a versioning | ||
scheme (typically PEP 440 compliant and in the form `major.minor.bugfix`), | ||
and a way to access it via `module.__version__`. The API standard version is | ||
completely independent from the package version. Given the standardization | ||
process, it resembles a C/C++ versioning scheme (e.g. `C99`, `C++14`) more | ||
than Python package versioning. | ||
``` | ||
|
||
The frequency of releasing a new version of an API standard will likely be at | ||
regular intervals and on the order of one year, however no assumption on | ||
frequency of new versions appearing must be made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #115 (comment) you mentioned having this attribute on a non-compliant DataFrame object, as a way to go from that to a compliant one (unless I misunderstood the comment), which would not make this a fully correct check.
In general, this pathway seems missing in the current description? Assume you have written a function to work with a spec compliant dataframe API, is it then up to the user of your library to only pass such dataframes, or do we want a way that the function can check for any dataframe input if it can give in a compliant version of itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thanks Joris. We already have
DataFrame.dataframe
to get back out the user-facing/non-compliant one, but we indeed do need to add the conversion the other way.Let me open a follow-up issue right now, since I won't get to fixing that up today.