Skip to content

GH-52093 : AttributeError raised with pd.concat between a None and Timestamp #52433

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

Closed
wants to merge 19 commits into from

Conversation

ramvikrams
Copy link
Contributor

df = DataFrame(data)
data_2 = [{"A": pd.to_datetime("1990-12-20 00:00:00+00:00")}]
df_2 = DataFrame(data_2)
pd.concat([df, df_2])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pd.concat([df, df_2])
result = pd.concat([df, df_2])

And then construct the expected = DataFrame(...) result and then use tm.assert_frame_equal(result, expected)

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Could you add a whatsnew note in v2.0.1.rst too

@mroeschke mroeschke added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Apr 6, 2023
df_2 = DataFrame(data_2)
result = concat([df, df_2])
expected = DataFrame({"A": [pd.to_datetime("1990-12-20 00:00:00+00:00")]})
tm.assert_frame_equal(result, expected)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this test is failing from the logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually can you please suggest a possible fix

Copy link
Member

Choose a reason for hiding this comment

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

Check the result and make sure it has the same elements as expected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I tried, but it then says that there is a ValueError

@ramvikrams ramvikrams closed this Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: AttributeError raised with pd.concat between a None and Timestamp
2 participants