|
22 | 22 | import numpy as np |
23 | 23 | import pandas |
24 | 24 | from pandas._libs import lib |
25 | | -from pandas._typing import ArrayLike, Axis, DtypeObj, IndexKeyFunc, Scalar, Sequence |
| 25 | +from pandas._typing import ArrayLike, Axis, DtypeObj, IndexKeyFunc, Scalar, Sequence, StorageOptions |
26 | 26 | from pandas.api.types import is_integer |
27 | 27 | from pandas.core.arrays import ExtensionArray |
28 | 28 | from pandas.core.common import apply_if_callable, is_bool_indexer |
@@ -2189,6 +2189,44 @@ def to_frame( |
2189 | 2189 |
|
2190 | 2190 | return DataFrame(self_cp) |
2191 | 2191 |
|
| 2192 | + def to_json( |
| 2193 | + self, |
| 2194 | + path_or_buf=None, |
| 2195 | + orient=None, |
| 2196 | + date_format=None, |
| 2197 | + double_precision=10, |
| 2198 | + force_ascii=True, |
| 2199 | + date_unit="ms", |
| 2200 | + default_handler=None, |
| 2201 | + lines=False, |
| 2202 | + compression="infer", |
| 2203 | + index=None, |
| 2204 | + indent=None, |
| 2205 | + storage_options: StorageOptions = None, |
| 2206 | + mode="w", |
| 2207 | + ) -> str | None: |
| 2208 | + from modin.core.execution.dispatching.factories.dispatcher import ( |
| 2209 | + FactoryDispatcher, |
| 2210 | + ) |
| 2211 | + |
| 2212 | + return FactoryDispatcher.to_json_series( |
| 2213 | + self._query_compiler, |
| 2214 | + path_or_buf, |
| 2215 | + orient=orient, |
| 2216 | + date_format=date_format, |
| 2217 | + double_precision=double_precision, |
| 2218 | + force_ascii=force_ascii, |
| 2219 | + date_unit=date_unit, |
| 2220 | + default_handler=default_handler, |
| 2221 | + lines=lines, |
| 2222 | + compression=compression, |
| 2223 | + index=index, |
| 2224 | + indent=indent, |
| 2225 | + storage_options=storage_options, |
| 2226 | + mode=mode, |
| 2227 | + ) |
| 2228 | + |
| 2229 | + |
2192 | 2230 | def to_list(self) -> list: # noqa: RT01, D200 |
2193 | 2231 | """ |
2194 | 2232 | Return a list of the values. |
|
0 commit comments