Skip to content

Commit 0223c0c

Browse files
authored
BUG: Fix pandas._libs.json __name__ (#52903)
1 parent aa1f96b commit 0223c0c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

doc/source/whatsnew/v2.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Other
424424
- Bug in :meth:`DataFrame.reindex` with a ``fill_value`` that should be inferred with a :class:`ExtensionDtype` incorrectly inferring ``object`` dtype (:issue:`52586`)
425425
- Bug in :meth:`Series.map` when giving a callable to an empty series, the returned series had ``object`` dtype. It now keeps the original dtype (:issue:`52384`)
426426
- Bug in :meth:`Series.memory_usage` when ``deep=True`` throw an error with Series of objects and the returned value is incorrect, as it does not take into account GC corrections (:issue:`51858`)
427-
-
427+
- Fixed incorrect ``__name__`` attribute of ``pandas._libs.json`` (:issue:`52898`)
428428

429429
.. ***DO NOT USE THIS SECTION***
430430

pandas/_libs/src/ujson/python/ujson.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int module_clear(PyObject *m);
8383
static void module_free(void *module);
8484

8585
static struct PyModuleDef moduledef = {.m_base = PyModuleDef_HEAD_INIT,
86-
.m_name = "_libjson",
86+
.m_name = "pandas._libs.json",
8787
.m_methods = ujsonMethods,
8888
.m_size = sizeof(modulestate),
8989
.m_traverse = module_traverse,

pandas/tests/io/json/test_ujson.py

+4
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ def e(self):
694694
test_object = _TestObject(a=1, b=2, _c=3, d=4)
695695
assert ujson.decode(ujson.encode(test_object)) == {"a": 1, "b": 2, "d": 4}
696696

697+
def test_ujson__name__(self):
698+
# GH 52898
699+
assert ujson.__name__ == "pandas._libs.json"
700+
697701

698702
class TestNumpyJSONTests:
699703
@pytest.mark.parametrize("bool_input", [True, False])

0 commit comments

Comments
 (0)