Skip to content

Commit b901c3d

Browse files
committed
JSON comments
1 parent 462a4f7 commit b901c3d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ static PyObject *get_values(PyObject *obj) {
227227
PyObject *values = PyObject_GetAttrString(obj, "values");
228228
PRINTMARK();
229229

230+
// Not part of the EA-interface. Just a temporary fix to get
231+
// things working for DatetimeArray.
230232
if (PyObject_HasAttrString(obj, "_to_json_values")) {
231233
PyObject *subvals = PyObject_CallMethod(obj, "_to_json_values", NULL);
232234
Py_DECREF(values);

pandas/core/arrays/datetimes.py

+2
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,8 @@ def to_julian_date(self):
15681568
) / 24.0)
15691569

15701570
def _to_json_values(self):
1571+
# Patch to get JSON serialization working again.
1572+
# Not part of the public API.
15711573
from pandas import DatetimeIndex
15721574
return DatetimeIndex(self)
15731575

pandas/core/internals/blocks.py

+2
Original file line numberDiff line numberDiff line change
@@ -3013,6 +3013,8 @@ def get_values(self, dtype=None):
30133013
return values.reshape(1, -1)
30143014

30153015
def _to_json_values(self):
3016+
# Patch to get JSON serialization working again.
3017+
# Not part of the public API.
30163018
from pandas import DatetimeIndex
30173019
return DatetimeIndex(self.values)
30183020

0 commit comments

Comments
 (0)