10000 move api_version to dataframe_standard (#206) · MarcoGorelli/dataframe-api@3fd047f · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fd047f

Browse files
authored
move api_version to dataframe_standard (data-apis#206)
1 parent 1befed8 commit 3fd047f

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

spec/API_specification/dataframe_api/dataframe_object.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,9 @@ class DataFrame:
3737
**Methods and Attributes**
3838
3939
"""
40-
def __dataframe_namespace__(
41-
self, /, *, api_version: str | None = None
42-
) -> Any:
40+
def __dataframe_namespace__(self) -> Any:
4341
"""
44-
Returns an object that has all the dataframe API functions on it.
45-
46-
Parameters
47-
----------
48-
api_version: Optional[str]
49-
String representing the version of the dataframe API specification
50-
to be returned, in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
51-
If it is ``None``, it should return the namespace corresponding to
52-
latest version of the dataframe API specification. If the given
53-
version is invalid or not implemented for the given module, an
54-
error should be raised. Default: ``None``.
42+
Returns an object that has all the top-level dataframe API functions on it.
5543
5644
Returns
5745
-------
@@ -61,7 +49,6 @@ def __dataframe_namespace__(
6149
attribute. It may contain other public names as well, but it is
6250
recommended to only include those names that are part of the
6351
specification.
64-
6552
"""
6653

6754
@property

spec/purpose_and_scope.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,20 @@ are required to provide the following methods:
367367
For example, pandas would have ``pandas.DataFrame.__dataframe_standard__`` and
368368
``pandas.Series.__column_standard__``.
369369

370+
The signatures should be (note: docstring is optional):
371+
```python
372+
def __dataframe_standard__(
373+
self, /, *, api_version: str | None = None
374+
) -> Any:
375+
376+
def __column_standard__(
377+
self, /, *, api_version: str | None = None
378+
) -> Any:
379+
```
380+
`api_version` is
381+
a string representing the version of the dataframe API specification
382+
to be returned, in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
383+
If it is ``None``, it should return the namespace corresponding to
384+
latest version of the dataframe API specification. If the given
385+
version is invalid or not implemented for the given module, an
386+
error should be raised. Default: ``None``.

0 commit comments

Comments
 (0)
0