Skip to content

TST: Regression test added for Timedelta #52748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 19, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ def test_constructor_from_ndarray_with_str_dtype(self):
expected = DataFrame(arr.astype(str))
tm.assert_frame_equal(df, expected)

def test_no_overflow_of_freq_and_time_in_dataframe(self):
# GH 35665
foo = DataFrame(
{
"some_string": ["2222Y3"],
"time": [Timedelta("0 days 00:00:00.990000")],
}
)
for _, row in foo.iterrows():
assert row.dtype == "object"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably belongs in tests.frame.methods.test_iterrows (which you'll have to create if it doesnt already exist)


def test_constructor_from_2d_datetimearray(self, using_array_manager):
dti = date_range("2016-01-01", periods=6, tz="US/Pacific")
dta = dti._data.reshape(3, 2)
Expand Down