Skip to content

Commit 32606c5

Browse files
committed
change default back to False
1 parent e07e8f5 commit 32606c5

File tree

6 files changed

+8
-181
lines changed

6 files changed

+8
-181
lines changed

hack.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

hacking_asfreq.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

hacking_offsetting.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

hacking_resample.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

pandas/core/frame.py

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

12881288
return cls(mgr)
12891289

1290-
def to_records(self, index=True, convert_datetime64=None):
1290+
def to_records(self, index=True, convert_datetime64=False):
12911291
"""
12921292
Convert DataFrame to a NumPy record array.
12931293
@@ -1355,13 +1355,11 @@ def to_records(self, index=True, convert_datetime64=None):
13551355
dtype=[('index', '<M8[ns]'), ('A', '<i8'), ('B', '<f8')])
13561356
"""
13571357

1358-
if convert_datetime64 is not None:
1358+
if convert_datetime64:
13591359
warnings.warn("The 'convert_datetime64' parameter is "
13601360
"deprecated and will be removed in a future "
13611361
"version",
13621362
FutureWarning, stacklevel=2)
1363-
else:
1364-
convert_datetime64 = True
13651363

13661364
if index:
13671365
if is_datetime64_any_dtype(self.index) and convert_datetime64:

pandas/tests/frame/test_convert_to.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,16 @@ def test_to_records_dt64(self):
7979
["four", "five", "six"]],
8080
index=date_range("2012-01-01", "2012-01-02"))
8181

82-
with tm.assert_produces_warning(FutureWarning):
83-
expected = df.index[0]
84-
result = df.to_records(convert_datetime64=True)['index'][0]
85-
assert expected == result
86-
87-
expected = df.index[0]
88-
# convert_datetime64 defaults to True if not passed
82+
# convert_datetime64 defaults to False if not passed
83+
expected = df.index.values[0]
8984
result = df.to_records()['index'][0]
9085
assert expected == result
9186

87+
# check for FutureWarning if convert_datetime64=True is passed
9288
with tm.assert_produces_warning(FutureWarning):
93-
rs = df.to_records(convert_datetime64=False)
94-
assert rs['index'][0] == df.index.values[0]
89+
expected = df.index[0]
90+
result = df.to_records(convert_datetime64=True)['index'][0]
91+
assert expected == result
9592

9693
def test_to_records_with_multindex(self):
9794
# GH3189

0 commit comments

Comments
 (0)