Skip to content

Commit

Permalink
add scalar.__scalar_namespace__ (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Nov 23, 2023
1 parent 4980320 commit bc74191
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion spec/API_specification/dataframe_api/scalar_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if TYPE_CHECKING:
from typing_extensions import Self

from dataframe_api.typing import AnyScalar, DType
from dataframe_api.typing import AnyScalar, DType, Namespace

__all__ = ["Scalar"]

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

def __scalar_namespace__(self) -> Namespace:
"""Return an object that has all the Dataframe Standard API functions on it.
Returns
-------
namespace
An object representing the dataframe API namespace. It should have
every top-level function defined in the specification as an
attribute. It may contain other public names as well, but it is
recommended to only include those names that are part of the
specification.
"""
...

def __lt__(self, other: AnyScalar) -> Scalar:
...

Expand Down

0 comments on commit bc74191

Please sign in to comment.