Skip to content

Commit bb23906

Browse files
committed
fix(pyright): 'Run pyright on 'tests' using the installed stubs'
1 parent 585c942 commit bb23906

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

pandas-stubs/_config/config.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,5 @@ class option_context(ContextDecorator):
182182
def __exit__(self, *args: object) -> None: ...
183183

184184
class OptionError(AttributeError, KeyError): ...
185+
186+
__all__ = ["DictWrapper", "Display", "Options"]

pandas-stubs/_testing/__init__.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,5 @@ def assert_produces_warning(
187187
def ensure_clean(
188188
filename: str | None = ..., return_filelike: bool = ..., **kwargs: Any
189189
) -> Generator[str, None, None]: ...
190+
191+
__all__ = ["ensure_clean"]

pandas-stubs/_typing.pyi

+26-1
Original file line numberDiff line numberDiff line change
@@ -842,4 +842,29 @@ IntoColumn: TypeAlias = (
842842
AnyArrayLike | Scalar | Callable[[DataFrame], AnyArrayLike | Scalar]
843843
)
844844

845-
__all__ = ["npt", "type_t"]
845+
__all__ = [
846+
"npt",
847+
"type_t",
848+
"T",
849+
"TakeIndexer",
850+
"type_t",
851+
"DtypeObj",
852+
"Scalar",
853+
"IntervalClosedType",
854+
"TimeUnit",
855+
"np_ndarray_bool",
856+
"BooleanDtypeArg",
857+
"BytesDtypeArg",
858+
"CategoryDtypeArg",
859+
"FloatDtypeArg",
860+
"IntDtypeArg",
861+
"ObjectDtypeArg",
862+
"StrDtypeArg",
863+
"TimedeltaDtypeArg",
864+
"TimestampDtypeArg",
865+
"UIntDtypeArg",
866+
"VoidDtypeArg",
867+
"np_ndarray_int",
868+
"FulldatetimeDict",
869+
"TimeUnit",
870+
]

pandas-stubs/io/json/_json.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,5 @@ class JsonReader(abc.Iterator, Generic[NDFrameT]):
238238
exc_value: BaseException | None,
239239
traceback: TracebackType | None,
240240
) -> None: ...
241+
242+
__all__ = ["read_json", "JsonReader"]

tests/test_scalars.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def test_timedelta_add_sub() -> None:
580580
)
581581
check(
582582
assert_type( # type: ignore[assert-type]
583-
as_timedelta64 + td, # pyright: ignore[reportAssertTypeFailure]
583+
as_timedelta64 + td,
584584
pd.Timedelta,
585585
),
586586
pd.Timedelta,
@@ -645,7 +645,7 @@ def test_timedelta_add_sub() -> None:
645645
)
646646
check(
647647
assert_type( # type: ignore[assert-type]
648-
as_timedelta64 - td, # pyright: ignore[reportAssertTypeFailure]
648+
as_timedelta64 - td,
649649
pd.Timedelta,
650650
),
651651
pd.Timedelta,

0 commit comments

Comments
 (0)