Skip to content

Commit 35598ee

Browse files
committed
type-hint
1 parent 40448cc commit 35598ee

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

pandas/core/reshape/encoding.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
from pandas.core.series import Series
3838

3939
if TYPE_CHECKING:
40-
from pandas._typing import NpDtype
40+
from pandas._typing import (
41+
DtypeObj,
42+
NpDtype,
43+
)
4144

4245

4346
def get_dummies(
@@ -556,7 +559,7 @@ def from_dummies(
556559
"Dummy DataFrame contains multi-assignment(s); "
557560
f"First instance in row: {assigned.idxmax()}"
558561
)
559-
dtype = data.columns.dtype
562+
dtype: str | DtypeObj = data.columns.dtype
560563
if any(assigned == 0):
561564
if isinstance(default_category, dict):
562565
value = default_category[prefix]

pandas/tests/io/pytables/test_complex.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
from pandas._config import using_string_dtype
5-
64
import pandas as pd
75
from pandas import (
86
DataFrame,
@@ -13,9 +11,9 @@
1311

1412
from pandas.io.pytables import read_hdf
1513

16-
pytestmark = pytest.mark.xfail(
17-
using_string_dtype(), reason="TODO(infer_string)", strict=False
18-
)
14+
# pytestmark = pytest.mark.xfail(
15+
# using_string_dtype(), reason="TODO(infer_string)", strict=False
16+
# )
1917

2018

2119
def test_complex_fixed(tmp_path, setup_path):

pandas/tests/io/pytables/test_file_handling.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas._config import using_string_dtype
7-
86
from pandas.compat import (
97
PY311,
108
is_ci_environment,
@@ -329,7 +327,7 @@ def test_complibs(tmp_path, lvl, lib, request):
329327
assert node.filters.complib == lib
330328

331329

332-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False)
330+
# @pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False)
333331
@pytest.mark.skipif(
334332
not is_platform_little_endian(), reason="reason platform is not little endian"
335333
)
@@ -347,7 +345,7 @@ def test_encoding(setup_path):
347345
tm.assert_frame_equal(result, expected)
348346

349347

350-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False)
348+
# @pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False)
351349
@pytest.mark.parametrize(
352350
"val",
353351
[

pandas/tests/io/pytables/test_timezones.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import numpy as np
77
import pytest
88

9-
from pandas._config import using_string_dtype
10-
119
from pandas._libs.tslibs.timezones import maybe_get_tz
1210
import pandas.util._test_decorators as td
1311

@@ -25,9 +23,9 @@
2523
ensure_clean_store,
2624
)
2725

28-
pytestmark = pytest.mark.xfail(
29-
using_string_dtype(), reason="TODO(infer_string)", strict=False
30-
)
26+
# pytestmark = pytest.mark.xfail(
27+
# using_string_dtype(), reason="TODO(infer_string)", strict=False
28+
# )
3129

3230

3331
def _compare_with_tz(a, b):

0 commit comments

Comments
 (0)