|
3 | 3 | """
|
4 | 4 | from __future__ import annotations
|
5 | 5 |
|
6 |
| -from typing import Mapping, Sequence |
| 6 | +from typing import Mapping, Sequence, Any |
7 | 7 |
|
8 | 8 | from .column_object import *
|
9 | 9 | from .dataframe_object import *
|
|
14 | 14 |
|
15 | 15 | __dataframe_api_version__: str = "YYYY.MM"
|
16 | 16 | """
|
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. |
19 | 20 | """
|
20 | 21 |
|
21 | 22 | def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
|
@@ -73,3 +74,48 @@ def dataframe_from_dict(data: Mapping[str, Column]) -> DataFrame:
|
73 | 74 | DataFrame
|
74 | 75 | """
|
75 | 76 | ...
|
| 77 | + |
| 78 | +class null: |
| 79 | + """ |
| 80 | + A `null` object to represent missing data. |
| 81 | +
|
| 82 | + ``null`` is a scalar, and may be used when constructing a `Column` from a |
| 83 | + Python sequence with `column_from_sequence`. It does not support ``is``, |
| 84 | + ``==`` or ``bool``. |
| 85 | +
|
| 86 | + Raises |
| 87 | + ------ |
| 88 | + TypeError |
| 89 | + From ``__eq__`` and from ``__bool__``. |
| 90 | +
|
| 91 | + For ``__eq__``: a missing value must not be compared for equality |
| 92 | + directly. Instead, use `DataFrame.isnull` or `Column.isnull` to check |
| 93 | + for presence of missing values. |
| 94 | +
|
| 95 | + For ``__bool__``: truthiness of a missing value is ambiguous. |
| 96 | +
|
| 97 | + Notes |
| 98 | + ----- |
| 99 | + Like for Python scalars, the ``null`` object may be duck typed so it can |
| 100 | + reside on (e.g.) a GPU. Hence, the builtin ``is`` keyword should not be |
| 101 | + used to check if an object *is* the ``null`` object. |
| 102 | +
|
| 103 | + """ |
| 104 | + ... |
| 105 | + |
| 106 | +def isnull(value: object, /) -> bool: |
| 107 | + """ |
| 108 | + Check if an object is a `null` scalar. |
| 109 | +
|
| 110 | + Parameters |
| 111 | + ---------- |
| 112 | + value : object |
| 113 | + Any input type is valid. |
| 114 | +
|
| 115 | + Returns |
| 116 | + ------- |
| 117 | + bool |
| 118 | + True if the input is a `null` object from the same library which |
| 119 | + implements the dataframe API standard, False otherwise. |
| 120 | +
|
| 121 | + """ |
0 commit comments