Skip to content

Commit 9773aaa

Browse files
committed
BUG: remove whatsnew (pandas-dev#39189)
1 parent 8284e0b commit 9773aaa

File tree

2 files changed

+43
-44
lines changed

2 files changed

+43
-44
lines changed

doc/source/whatsnew/v1.3.0.rst

-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ I/O
327327
- Bug in :func:`read_csv` not switching ``true_values`` and ``false_values`` for nullable ``boolean`` dtype (:issue:`34655`)
328328
- Bug in :func:`read_json` when ``orient="split"`` does not maintain numeric string index (:issue:`28556`)
329329
- :meth:`read_sql` returned an empty generator if ``chunksize`` was no-zero and the query returned no results. Now returns a generator with a single empty dataframe (:issue:`34411`)
330-
- Bug in :func:`read_hdf` returning unexpected records when filtering on categorical string columns using ``where`` parameter (:issue:`39189`)
331330

332331
Period
333332
^^^^^^
+43-43
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
# from typing import Any
2-
# from unittest.mock import PropertyMock, patch
3-
#
4-
# import pytest
5-
#
6-
# from pandas.core.computation.pytables import BinOp, TermValue
7-
# from pandas.core.series import Series
8-
#
9-
#
10-
# @patch(
11-
# "pandas.core.computation.pytables.BinOp.kind",
12-
# new_callable=PropertyMock,
13-
# return_value="integer",
14-
# )
15-
# @patch(
16-
# "pandas.core.computation.pytables.BinOp.meta",
17-
# new_callable=PropertyMock,
18-
# return_value="category",
19-
# )
20-
# @patch(
21-
# "pandas.core.computation.pytables.BinOp.metadata",
22-
# new_callable=PropertyMock,
23-
# return_value=Series(data=["a", "b", "s"]),
24-
# )
25-
# @pytest.mark.parametrize(
26-
# "value, expected_results",
27-
# [("q", TermValue(-1, -1, "integer")), ("a", TermValue(0, 0, "integer"))],
28-
# )
29-
# def test_convert_value(
30-
# mock_kind, mock_meta, mock_metadata, value: Any, expected_results: TermValue
31-
# ):
32-
#
33-
# with patch.object(BinOp, "__init__", lambda p1, p2, p3, p4, p5, p6: None):
34-
# bin_op = BinOp(None, None, None, None, None)
35-
# bin_op.encoding = "UTF-8"
36-
#
37-
# result = bin_op.convert_value(value)
38-
#
39-
# assert (
40-
# result.kind == expected_results.kind
41-
# and result.value == expected_results.value
42-
# and result.converted == expected_results.converted
43-
# )
1+
from typing import Any
2+
from unittest.mock import PropertyMock, patch
3+
4+
import pytest
5+
6+
from pandas.core.computation.pytables import BinOp, TermValue
7+
from pandas.core.series import Series
8+
9+
10+
@patch(
11+
"pandas.core.computation.pytables.BinOp.kind",
12+
new_callable=PropertyMock,
13+
return_value="integer",
14+
)
15+
@patch(
16+
"pandas.core.computation.pytables.BinOp.meta",
17+
new_callable=PropertyMock,
18+
return_value="category",
19+
)
20+
@patch(
21+
"pandas.core.computation.pytables.BinOp.metadata",
22+
new_callable=PropertyMock,
23+
return_value=Series(data=["a", "b", "s"]),
24+
)
25+
@pytest.mark.parametrize(
26+
"value, expected_results",
27+
[("q", TermValue(-1, -1, "integer")), ("a", TermValue(0, 0, "integer"))],
28+
)
29+
def test_convert_value(
30+
mock_kind, mock_meta, mock_metadata, value: Any, expected_results: TermValue
31+
):
32+
33+
with patch.object(BinOp, "__init__", lambda p1, p2, p3, p4, p5, p6: None):
34+
bin_op = BinOp(None, None, None, None, None)
35+
bin_op.encoding = "UTF-8"
36+
37+
result = bin_op.convert_value(value)
38+
39+
assert (
40+
result.kind == expected_results.kind
41+
and result.value == expected_results.value
42+
and result.converted == expected_results.converted
43+
)

0 commit comments

Comments
 (0)