Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update enums to reflect typing spec changes #1020

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions pandas-stubs/_libs/tslibs/dtypes.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enum import Enum
from typing import cast

from .offsets import BaseOffset

Expand Down Expand Up @@ -29,16 +30,16 @@ class FreqGroup:
def get_freq_group(code: int) -> int: ...

class Resolution(Enum):
RESO_NS: int
RESO_US: int
RESO_MS: int
RESO_SEC: int
RESO_MIN: int
RESO_HR: int
RESO_DAY: int
RESO_MTH: int
RESO_QTR: int
RESO_YR: int
RESO_NS = cast(int, ...)
RESO_US = cast(int, ...)
RESO_MS = cast(int, ...)
RESO_SEC = cast(int, ...)
RESO_MIN = cast(int, ...)
RESO_HR = cast(int, ...)
RESO_DAY = cast(int, ...)
RESO_MTH = cast(int, ...)
RESO_QTR = cast(int, ...)
RESO_YR = cast(int, ...)

def __lt__(self, other) -> bool: ...
def __ge__(self, other) -> bool: ...
Expand Down
41 changes: 21 additions & 20 deletions pandas-stubs/core/interchange/dataframe_protocol.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,34 @@ import enum
from typing import (
Any,
TypedDict,
cast,
)

class DlpackDeviceType(enum.IntEnum):
CPU: int
CUDA: int
CPU_PINNED: int
OPENCL: int
VULKAN: int
METAL: int
VPI: int
ROCM: int
CPU = cast(int, ...)
CUDA = cast(int, ...)
CPU_PINNED = cast(int, ...)
OPENCL = cast(int, ...)
VULKAN = cast(int, ...)
METAL = cast(int, ...)
VPI = cast(int, ...)
ROCM = cast(int, ...)

class DtypeKind(enum.IntEnum):
INT: int
UINT: int
FLOAT: int
BOOL: int
STRING: int
DATETIME: int
CATEGORICAL: int
INT = cast(int, ...)
UINT = cast(int, ...)
FLOAT = cast(int, ...)
BOOL = cast(int, ...)
STRING = cast(int, ...)
DATETIME = cast(int, ...)
CATEGORICAL = cast(int, ...)

class ColumnNullType(enum.IntEnum):
NON_NULLABLE: int
USE_NAN: int
USE_SENTINEL: int
USE_BITMASK: int
USE_BYTEMASK: int
NON_NULLABLE = cast(int, ...)
USE_NAN = cast(int, ...)
USE_SENTINEL = cast(int, ...)
USE_BITMASK = cast(int, ...)
USE_BYTEMASK = cast(int, ...)

class ColumnBuffers(TypedDict):
data: tuple[Buffer, Any]
Expand Down
3 changes: 2 additions & 1 deletion scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import sys
from typing import Any

from loguru import logger

# Config the format of log message
config = {
config: dict[str, Any] = {
"handlers": [
{
"sink": sys.stderr,
Expand Down
Loading