Skip to content

Commit 0ca0c9e

Browse files
committed
pre-commit checks
1 parent 4a13c49 commit 0ca0c9e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,9 @@ I/O
773773
- Bug in :meth:`DataFrame.to_excel` when writing empty :class:`DataFrame` with :class:`MultiIndex` on both axes (:issue:`57696`)
774774
- Bug in :meth:`DataFrame.to_excel` where the :class:`MultiIndex` index with a period level was not a date (:issue:`60099`)
775775
- Bug in :meth:`DataFrame.to_stata` when exporting a column containing both long strings (Stata strL) and :class:`pd.NA` values (:issue:`23633`)
776+
- Bug in :meth:`DataFrame.to_stata` when input encoded length and normal length are mismatched (:issue:`61583`)
776777
- Bug in :meth:`DataFrame.to_stata` when writing :class:`DataFrame` and ``byteorder=`big```. (:issue:`58969`)
777778
- Bug in :meth:`DataFrame.to_stata` when writing more than 32,000 value labels. (:issue:`60107`)
778-
- Bug in :meth:`DataFrame.to_stata` when input encoded length and normal length are mismatched (:issue:`61583`)
779779
- Bug in :meth:`DataFrame.to_string` that raised ``StopIteration`` with nested DataFrames. (:issue:`16098`)
780780
- Bug in :meth:`HDFStore.get` was failing to save data of dtype datetime64[s] correctly (:issue:`59004`)
781781
- Bug in :meth:`HDFStore.select` causing queries on categorical string columns to return unexpected results (:issue:`57608`)

pandas/io/stata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,11 +3263,11 @@ def generate_blob(self, gso_table: dict[str, tuple[int, int]]) -> bytes:
32633263
bio.write(gso_type)
32643264

32653265
# llll
3266-
if(isinstance(strl, str)):
3266+
if isinstance(strl, str):
32673267
strl_convert = bytes(strl, "utf-8")
32683268
else:
32693269
strl_convert = strl
3270-
3270+
32713271
bio.write(struct.pack(len_type, len(strl_convert) + 1))
32723272

32733273
# xxx...xxx

pandas/tests/io/test_stata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,11 +2602,12 @@ def test_strl_missings(temp_file, version):
26022602
)
26032603
df.to_stata(temp_file, version=version)
26042604

2605+
26052606
@pytest.mark.parametrize("version", [117, 118, 119, None])
26062607
def test_ascii_error(temp_file, version):
26072608
# GH #61583
26082609
# Check that 2 byte long unicode characters doesn't cause export error
2609-
df = pd.DataFrame({'doubleByteCol': ['§'*1500]})
2610+
df = DataFrame({"doubleByteCol": ["§" * 1500]})
26102611
df.to_stata(temp_file, write_index=0, version=version)
26112612
df_input = read_stata(temp_file)
2612-
tm.assert_frame_equal(df, df_input)
2613+
tm.assert_frame_equal(df, df_input)

0 commit comments

Comments
 (0)