Skip to content

Commit f0464f7

Browse files
committed
changing default to None
1 parent 5b1029e commit f0464f7

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
@@ -832,7 +832,7 @@ Deprecations
832832
- ``pandas.tseries.plotting.tsplot`` is deprecated. Use :func:`Series.plot` instead (:issue:`18627`)
833833
- ``Index.summary()`` is deprecated and will be removed in a future version (:issue:`18217`)
834834
- ``NDFrame.get_ftype_counts()`` is deprecated and will be removed in a future version (:issue:`18243`)
835-
- 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`).
835+
- 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`).
836836

837837
.. _whatsnew_0230.prior_deprecations:
838838

pandas/core/frame.py

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

12981298
return cls(mgr)
12991299

1300-
def to_records(self, index=True, convert_datetime64=False):
1300+
def to_records(self, index=True, convert_datetime64=None):
13011301
"""
13021302
Convert DataFrame to a NumPy record array.
13031303
@@ -1365,7 +1365,7 @@ def to_records(self, index=True, convert_datetime64=False):
13651365
dtype=[('index', '<M8[ns]'), ('A', '<i8'), ('B', '<f8')])
13661366
"""
13671367

1368-
if convert_datetime64:
1368+
if convert_datetime64 is not None:
13691369
warnings.warn("The 'convert_datetime64' parameter is "
13701370
"deprecated and will be removed in a future "
13711371
"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)