Skip to content

Commit 87a7f36

Browse files
committed
make api_version required
1 parent 202a643 commit 87a7f36

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

spec/API_specification/dataframe_api/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ def is_dtype(dtype: Any, kind: str | tuple[str, ...]) -> bool:
149149

150150
class SupportsDataFrameAPI(Protocol):
151151
def __dataframe_consortium_standard__(
152-
self, *, api_version: str | None = None
152+
self, *, api_version: str
153153
) -> DataFrame:
154154
...
155155

156156
class SupportsColumnAPI(Protocol):
157157
def __column_consortium_standard__(
158-
self, *, api_version: str | None = None
158+
self, *, api_version: str
159159
) -> Column:
160160
...
161161

spec/purpose_and_scope.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,19 @@ For example, pandas has ``pandas.DataFrame.__dataframe_consortium_standard__`` a
260260
The signatures should be (note: docstring is optional):
261261
```python
262262
def __dataframe_consortium_standard__(
263-
self, *, api_version: str | None = None
263+
self, *, api_version: str
264264
) -> Any:
265265

266266
def __column_consortium_standard__(
267-
self, *, api_version: str | None = None
267+
self, *, api_version: str
268268
) -> Any:
269269
```
270270
`api_version` is
271271
a string representing the version of the dataframe API specification
272272
to be returned, in ``'YYYY.MM'`` form, for example, ``'2023.04'``.
273-
If it is ``None``, it should return the namespace corresponding to
274-
latest version of the dataframe API specification. If the given
275-
version is invalid or not implemented for the given module, an
276-
error should be raised. Default: ``None``.
273+
If the given version is invalid or not implemented for the given module,
274+
an error should be raised. It is suggested to use the earliest API
275+
version required for maximum compatibility.
277276

278277
For some examples, please check https://github.com/data-apis/dataframe-api/tree/main/spec/examples.
279278

0 commit comments

Comments
 (0)