Skip to content

Commit

Permalink
remove Field generic type var _Nullable (#58)
Browse files Browse the repository at this point in the history
* remove Field generic type var _Nullable
  • Loading branch information
zen-xu authored Aug 30, 2024
1 parent 9e85dd0 commit 5e17936
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions pyarrow-stubs/__lib_pxi/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ _K = TypeVar("_K", bound=_BasicDataType)

class MapType(DataType, Generic[_K, _ValueT, _Ordered]):
@property
def key_field(self) -> Field[_K, Literal[False]]: ...
def key_field(self) -> Field[_K]: ...
@property
def key_type(self) -> _K: ...
@property
Expand Down Expand Up @@ -245,13 +245,11 @@ def ensure_metadata(
meta: Mapping[bytes | str, bytes | str] | KeyValueMetadata | None, allow_none: bool = False
) -> KeyValueMetadata | None: ...

_Nullable = TypeVar("_Nullable", bound=Literal[True, False], default=Literal[True])

class Field(_Weakrefable, Generic[_DataType_CoT, _Nullable]):
class Field(_Weakrefable, Generic[_DataType_CoT]):
def equals(self, other: Field, check_metadata: bool = False) -> bool: ...
def __hash__(self) -> int: ...
@property
def nullable(self) -> _Nullable: ...
def nullable(self) -> bool: ...
@property
def name(self) -> str: ...
@property
Expand All @@ -260,7 +258,7 @@ class Field(_Weakrefable, Generic[_DataType_CoT, _Nullable]):
def remove_metadata(self) -> None: ...
def with_type(self, new_type: _DataTypeT) -> Field[_DataTypeT]: ...
def with_name(self, name: str) -> Self: ...
def with_nullable(self, nullable: _Nullable) -> Field[_DataType_CoT, _Nullable]: ...
def with_nullable(self, nullable: bool) -> Field[_DataType_CoT]: ...
def flatten(self) -> list[Field]: ...
def _export_to_c(self, out_ptr: int) -> None: ...
@classmethod
Expand Down Expand Up @@ -320,13 +318,8 @@ def unify_schemas(
def field(name: SupportArrowSchema) -> Field: ...
@overload
def field(
name: str,
type: _DataTypeT,
) -> Field[_DataTypeT, Literal[True]]: ...
@overload
def field(
name: str, type: _DataTypeT, nullable: _Nullable, metadata: dict | None = None
) -> Field[_DataTypeT, _Nullable]: ...
name: str, type: _DataTypeT, nullable: bool = ..., metadata: dict | None = None
) -> Field[_DataTypeT]: ...
def null() -> NullType: ...
def bool_() -> BoolType: ...
def uint8() -> Uint8Type: ...
Expand Down

0 comments on commit 5e17936

Please sign in to comment.