Skip to content

Commit 7676a90

Browse files
committed
Add null object, and update top-level API specification
1 parent 16aabbf commit 7676a90

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

spec/API_specification/dataframe_api/__init__.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
__dataframe_api_version__: str = "YYYY.MM"
1616
"""
17-
String representing the version of the DataFrame API specification to which the
18-
conforming implementation adheres.
17+
String representing the version of the DataFrame API specification to which
18+
the conforming implementation adheres. Set to a concrete value for a stable
19+
implementation of the dataframe API standard.
1920
"""
2021

2122
def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
@@ -73,3 +74,36 @@ def dataframe_from_dict(data: Mapping[str, Column]) -> DataFrame:
7374
DataFrame
7475
"""
7576
...
77+
78+
class null:
79+
"""
80+
A `null` singleton object to represent missing data.
81+
82+
``null`` may be used when constructing a `Column` from a Python sequence.
83+
It supports ``is``, and does not support ``==`` and ``bool``.
84+
85+
Methods
86+
-------
87+
__bool__
88+
__eq__
89+
90+
"""
91+
def __eq__(self):
92+
"""
93+
Raises
94+
------
95+
RuntimeError
96+
A missing value must not be compared for equality. Use ``is`` to check
97+
if an object *is* this ``null`` object, and `DataFrame.isnull` or
98+
`Column.isnull` to check for presence of missing values.
99+
"""
100+
...
101+
102+
def __bool__(self):
103+
"""
104+
Raises
105+
------
106+
TypeError
107+
Truthiness of a missing value is ambiguous
108+
"""
109+
...

spec/API_specification/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ API specification
55

66
.. currentmodule:: dataframe_api
77

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

0 commit comments

Comments
 (0)