Skip to content

Commit 287ca23

Browse files
committed
CLN: Restore changes to 1.0.0
Restore rename to 1.0.0
1 parent 155e2c8 commit 287ca23

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

doc/source/whatsnew/v1.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Other enhancements
223223
- :meth:`DataFrame.sort_values` and :meth:`Series.sort_values` have gained ``ignore_index`` keyword to be able to reset index after sorting (:issue:`30114`)
224224
- :meth:`DataFrame.sort_index` and :meth:`Series.sort_index` have gained ``ignore_index`` keyword to reset index (:issue:`30114`)
225225
- :meth:`DataFrame.drop_duplicates` has gained ``ignore_index`` keyword to reset index (:issue:`30114`)
226-
- Added new writer for exporting Stata dta files in version 118, ``StataWriter118``. This format supports exporting strings containing Unicode characters (:issue:`23573`)
226+
- Added new writer for exporting Stata dta files in versions 118 and 119, ``StataWriterUTF8``. These files formats support exporting strings containing Unicode characters. Format 119 supports data sets with more than 32,767 variables (:issue:`23573`, :issue:`30959`)
227227
- :meth:`Series.map` now accepts ``collections.abc.Mapping`` subclasses as a mapper (:issue:`29733`)
228228
- Added an experimental :attr:`~DataFrame.attrs` for storing global metadata about a dataset (:issue:`29062`)
229229
- :meth:`Timestamp.fromisocalendar` is now compatible with python 3.8 and above (:issue:`28115`)

pandas/core/frame.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1898,16 +1898,17 @@ def to_stata(
18981898
variable_labels : dict
18991899
Dictionary containing columns as keys and variable labels as
19001900
values. Each label must be 80 characters or smaller.
1901-
version : {114, 117, 118, 119, "utf-8"}, default 114
1901+
version : {114, 117, 118, 119, None}, default 114
19021902
Version to use in the output dta file. Set to None to let pandas
19031903
decide between 118 or 119 formats depending on the number of
19041904
columns in the frame. Version 114 can be read by Stata 10 and
19051905
later. Version 117 can be read by Stata 13 or later. Version 118
19061906
is supported in Stata 14 and later. Version 119 is supported in
19071907
Stata 15 and later. Version 114 limits string variables to 244
1908-
characters or fewer while 117 allows strings with lengths up to
1909-
2,000,000 characters. Versions 118 and 119 support Unicode
1910-
characters, and version 119 supports more than 32,767 variables.
1908+
characters or fewer while versions 117 and later allow strings
1909+
with lengths up to 2,000,000 characters. Versions 118 and 119
1910+
support Unicode characters, and version 119 supports more than
1911+
32,767 variables.
19111912
19121913
.. versionadded:: 0.23.0
19131914
@@ -1956,7 +1957,7 @@ def to_stata(
19561957
else: # versions 118 and 119
19571958
from pandas.io.stata import StataWriterUTF8 as statawriter
19581959

1959-
kwargs["version"] = version if version != "utf8" else None
1960+
kwargs["version"] = version
19601961

19611962
kwargs["convert_strl"] = convert_strl
19621963

pandas/io/stata.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pandas._libs.lib import infer_dtype
2525
from pandas._libs.writers import max_len_string_array
2626
from pandas._typing import FilePathOrBuffer
27-
from pandas.util._decorators import Appender, deprecate
27+
from pandas.util._decorators import Appender
2828

2929
from pandas.core.dtypes.common import (
3030
ensure_object,
@@ -3230,8 +3230,6 @@ class StataWriterUTF8(StataWriter117):
32303230
the version. 118 is used if data.shape[1] <= 32767, and 119 is used
32313231
for storing larger DataFrames.
32323232
3233-
.. versionadded:: 1.1.0
3234-
32353233
Returns
32363234
-------
32373235
StataWriterUTF8
@@ -3332,6 +3330,3 @@ def _validate_variable_name(self, name: str):
33323330
name = name.replace(c, "_")
33333331

33343332
return name
3335-
3336-
3337-
StataWriter118 = deprecate("pandas.io.stata.StataWriterUTF8", StataWriterUTF8, "2.0.0")

0 commit comments

Comments
 (0)