Skip to content

Commit e8c0f2f

Browse files
committed
Add null object, and update top-level API specification
1 parent 7059081 commit e8c0f2f

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

spec/API_specification/dataframe_api/__init__.py

+37-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,41 @@
99

1010
__dataframe_api_version__: str = "YYYY.MM"
1111
"""
12-
String representing the version of the DataFrame API specification to which the
13-
conforming implementation adheres.
12+
String representing the version of the DataFrame API specification to which
13+
the conforming implementation adheres. Set to a concrete value for a stable
14+
implementation of the dataframe API standard.
1415
"""
16+
17+
18+
class null:
19+
"""
20+
A `null` singleton object to represent missing data.
21+
22+
``null`` may be used when constructing a `Column` from a Python sequence.
23+
It supports ``is``, and does not support ``==`` and ``bool``.
24+
25+
Methods
26+
-------
27+
__bool__
28+
__eq__
29+
30+
"""
31+
def __eq__(self):
32+
"""
33+
Raises
34+
------
35+
RuntimeError
36+
A missing value must not be compared for equality. Use ``is`` to check
37+
if an object *is* this ``null`` object, and `DataFrame.isnull` or
38+
`Column.isnull` to check for presence of missing values.
39+
"""
40+
...
41+
42+
def __bool__(self):
43+
"""
44+
Raises
45+
------
46+
TypeError
47+
Truthiness of a missing value is ambiguous
48+
"""
49+
...

spec/API_specification/index.rst

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ API specification
33

44
.. currentmodule:: dataframe_api
55

6+
The API consists of dataframe, column and groupby classes, plus a small number
7+
of objects and functions in the top-level namespace. The latter are:
8+
9+
.. autosummary::
10+
:toctree: generated
11+
:template: attribute.rst
12+
:nosignatures:
13+
14+
__dataframe_api_version__
15+
null
16+
17+
The ``DataFrame``, ``Column`` and ``GroupBy`` objects have the following
18+
methods and attributes:
19+
620
.. toctree::
721
:maxdepth: 3
822

0 commit comments

Comments
 (0)