Skip to content

Commit bc74191

Browse files
authored
add scalar.__scalar_namespace__ (#334)
1 parent 4980320 commit bc74191

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

spec/API_specification/dataframe_api/scalar_object.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if TYPE_CHECKING:
66
from typing_extensions import Self
77

8-
from dataframe_api.typing import AnyScalar, DType
8+
from dataframe_api.typing import AnyScalar, DType, Namespace
99

1010
__all__ = ["Scalar"]
1111

@@ -26,6 +26,20 @@ class Scalar(Protocol):
2626
(even if it is backed by a null value).
2727
"""
2828

29+
def __scalar_namespace__(self) -> Namespace:
30+
"""Return an object that has all the Dataframe Standard API functions on it.
31+
32+
Returns
33+
-------
34+
namespace
35+
An object representing the dataframe API namespace. It should have
36+
every top-level function defined in the specification as an
37+
attribute. It may contain other public names as well, but it is
38+
recommended to only include those names that are part of the
39+
specification.
40+
"""
41+
...
42+
2943
def __lt__(self, other: AnyScalar) -> Scalar:
3044
...
3145

0 commit comments

Comments
 (0)