Skip to content

Commit e9ea582

Browse files
authored
fixed "pandas/util/*" = ["TCH"] (pandas-dev#51888)
* fixed "pandas/util/*" = ["TCH"] * ixups * Update _test_decorators.py
1 parent 83858b2 commit e9ea582

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

pandas/util/_print_versions.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
import platform
88
import struct
99
import sys
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from pandas._typing import JSONSerializable
1014

11-
from pandas._typing import JSONSerializable
1215
from pandas.compat._optional import (
1316
VERSIONS,
1417
get_version,

pandas/util/_test_decorators.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ def test_foo():
2626
from __future__ import annotations
2727

2828
import locale
29-
from typing import Callable
29+
from typing import (
30+
TYPE_CHECKING,
31+
Callable,
32+
)
3033

3134
import numpy as np
3235
import pytest
3336

3437
from pandas._config import get_option
3538

36-
from pandas._typing import F
39+
if TYPE_CHECKING:
40+
from pandas._typing import F
3741
from pandas.compat import (
3842
IS64,
3943
is_platform_windows,

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ exclude = [
295295
# TCH to be enabled gradually
296296
"pandas/core/arrays/*" = ["TCH"]
297297
"pandas/core/nanops.py" = ["TCH"]
298-
"pandas/util/*" = ["TCH"]
299298
"pandas/_libs/*" = ["TCH"]
300299
# Keep this one enabled
301300
"pandas/_typing.py" = ["TCH"]

0 commit comments

Comments
 (0)