Skip to content

Commit f75c97d

Browse files
committed
Merge branch '61442-json-escape-forward-slashes' of https://github.com/zephyrieal/pandas into 61442-json-escape-forward-slashes
2 parents 3776f2c + dfc457c commit f75c97d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ Other enhancements
162162
- :class:`pandas.api.typing.FrozenList` is available for typing the outputs of :attr:`MultiIndex.names`, :attr:`MultiIndex.codes` and :attr:`MultiIndex.levels` (:issue:`58237`)
163163
- :class:`pandas.api.typing.SASReader` is available for typing the output of :func:`read_sas` (:issue:`55689`)
164164
- Added :meth:`.Styler.to_typst` to write Styler objects to file, buffer or string in Typst format (:issue:`57617`)
165+
- Added functionality to support saving json without escaping forward slashes by adding to :meth:`DataFrame.to_json` (:issue:`61442`)
165166
- Added missing :meth:`pandas.Series.info` to API reference (:issue:`60926`)
166167
- :class:`pandas.api.typing.NoDefault` is available for typing ``no_default``
167168
- :func:`DataFrame.to_excel` now raises an ``UserWarning`` when the character count in a cell exceeds Excel's limitation of 32767 characters (:issue:`56954`)
@@ -228,7 +229,6 @@ Other enhancements
228229
- Support reading Stata 102-format (Stata 1) dta files (:issue:`58978`)
229230
- Support reading Stata 110-format (Stata 7) dta files (:issue:`47176`)
230231
- Switched wheel upload to **PyPI Trusted Publishing** (OIDC) for release-tag pushes in ``wheels.yml``. (:issue:`61718`)
231-
-
232232

233233
.. ---------------------------------------------------------------------------
234234
.. _whatsnew_300.notable_bug_fixes:

pandas/tests/io/json/test_pandas.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,10 +2298,8 @@ def test_to_json_escape_forward_slashes():
22982298
}
22992299
)
23002300
result = df.to_json(orient="records", escape_forward_slashes=False)
2301-
expected1 = """[{"path1":"/escape/three/slashes","path2":"/","path3":"ending/""" ""
2302-
expected2 = (
2303-
""","path4":"/beginning","path5":"/multiples//multiple","path6":"//"}]"""
2304-
)
2301+
expected1 = '[{"path1":"/escape/three/slashes","path2":"/","path3":"ending/"'
2302+
expected2 = ',"path4":"/beginning","path5":"/multiples//multiple","path6":"//"}]'
23052303
expected = expected1 + expected2
23062304

23072305
assert result == expected

0 commit comments

Comments
 (0)