Skip to content

Commit c13e724

Browse files
committed
changing default to None
1 parent dfa867c commit c13e724

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ Deprecations
842842
- ``pandas.tseries.plotting.tsplot`` is deprecated. Use :func:`Series.plot` instead (:issue:`18627`)
843843
- ``Index.summary()`` is deprecated and will be removed in a future version (:issue:`18217`)
844844
- ``NDFrame.get_ftype_counts()`` is deprecated and will be removed in a future version (:issue:`18243`)
845-
- The ``convert_datetime64`` parameter in :func:`DataFrame.to_records` has been deprecated and the default value is now ``False``. The NumPy bug motivating this parameter has been resolved (:issue:`18160`).
845+
- The ``convert_datetime64`` parameter in :func:`DataFrame.to_records` has been deprecated and will be removed in a future version. The NumPy bug motivating this parameter has been resolved (:issue:`18160`).
846846

847847
.. _whatsnew_0230.prior_deprecations:
848848

pandas/core/frame.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None,
13111311

13121312
return cls(mgr)
13131313

1314-
def to_records(self, index=True, convert_datetime64=False):
1314+
def to_records(self, index=True, convert_datetime64=None):
13151315
"""
13161316
Convert DataFrame to a NumPy record array.
13171317
@@ -1379,7 +1379,7 @@ def to_records(self, index=True, convert_datetime64=False):
13791379
dtype=[('index', '<M8[ns]'), ('A', '<i8'), ('B', '<f8')])
13801380
"""
13811381

1382-
if convert_datetime64:
1382+
if convert_datetime64 is not None:
13831383
warnings.warn("The 'convert_datetime64' parameter is "
13841384
"deprecated and will be removed in a future "
13851385
"version",

pandas/tests/frame/test_convert_to.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ def test_to_records_dt64(self):
8484
result = df.to_records(convert_datetime64=True)['index'][0]
8585
assert expected == result
8686

87-
rs = df.to_records(convert_datetime64=False)
88-
assert rs['index'][0] == df.index.values[0]
87+
with tm.assert_produces_warning(FutureWarning):
88+
rs = df.to_records(convert_datetime64=False)
89+
assert rs['index'][0] == df.index.values[0]
8990

9091
def test_to_records_with_multindex(self):
9192
# GH3189

0 commit comments

Comments
 (0)