Skip to content

Commit cba2287

Browse files
committed
changing default to None
1 parent 4bf0a9f commit cba2287

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ Deprecations
675675
- The ``broadcast`` parameter of ``.apply()`` is deprecated in favor of ``result_type='broadcast'`` (:issue:`18577`)
676676
- The ``reduce`` parameter of ``.apply()`` is deprecated in favor of ``result_type='reduce'`` (:issue:`18577`)
677677
- The ``order`` parameter of :func:`factorize` is deprecated and will be removed in a future release (:issue:`19727`)
678-
- 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`).
678+
- 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`).
679679

680680
.. _whatsnew_0230.prior_deprecations:
681681

pandas/core/frame.py

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

12051205
return cls(mgr)
12061206

1207-
def to_records(self, index=True, convert_datetime64=False):
1207+
def to_records(self, index=True, convert_datetime64=None):
12081208
"""
12091209
Convert DataFrame to record array. Index will be put in the
12101210
'index' field of the record array if requested
@@ -1213,7 +1213,7 @@ def to_records(self, index=True, convert_datetime64=False):
12131213
----------
12141214
index : boolean, default True
12151215
Include index in resulting record array, stored in 'index' field
1216-
convert_datetime64 : boolean, default False
1216+
convert_datetime64 : boolean, optional
12171217
.. deprecated:: 0.23.0
12181218
12191219
Whether to convert the index to datetime.datetime if it is a
@@ -1224,7 +1224,7 @@ def to_records(self, index=True, convert_datetime64=False):
12241224
y : recarray
12251225
"""
12261226

1227-
if convert_datetime64:
1227+
if convert_datetime64 is not None:
12281228
warnings.warn("The 'convert_datetime64' parameter is "
12291229
"deprecated and will be removed in a future "
12301230
"version",

pandas/tests/frame/test_convert_to.py

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

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

8990
def test_to_records_with_multindex(self):
9091
# GH3189

0 commit comments

Comments
 (0)