Skip to content

Commit

Permalink
chore(python): Narrow type hint for get_index_type util (pola-rs#13556
Browse files Browse the repository at this point in the history
)
  • Loading branch information
stinodego authored Jan 9, 2024
1 parent 00e1552 commit 149091a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions py-polars/polars/utils/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
from typing import TYPE_CHECKING

with contextlib.suppress(ImportError): # Module not available when building docs
from polars.polars import get_index_type as _get_index_type
from polars.polars import threadpool_size as _threadpool_size
import polars.polars as plr

if TYPE_CHECKING:
from polars.datatypes import DataTypeClass
from polars.datatypes import DataType


def get_index_type() -> DataTypeClass:
def get_index_type() -> DataType:
"""
Get the datatype used for Polars indexing.
Expand All @@ -26,7 +25,7 @@ def get_index_type() -> DataTypeClass:
>>> pl.get_index_type()
UInt32
"""
return _get_index_type()
return plr.get_index_type()


def threadpool_size() -> int:
Expand All @@ -47,4 +46,4 @@ def threadpool_size() -> int:
>>> pl.threadpool_size() # doctest: +SKIP
24
"""
return _threadpool_size()
return plr.threadpool_size()

0 comments on commit 149091a

Please sign in to comment.