Skip to content
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

DEPR: datetimelike inference with strings #41731

Merged

Conversation

jbrockmendel
Copy link
Member

this difference in behavior is one of the biggest things left keeping us from sharing more between Index/Series constructors.

@simonjayhawkins simonjayhawkins added API - Consistency Internal Consistency of API/Behavior Constructors Series/DataFrame/Index/pd.array Constructors Dtype Conversions Unexpected or buggy dtype conversions Deprecate Functionality to remove in pandas labels May 30, 2021
@@ -197,7 +197,8 @@ def test_to_timedelta_on_missing_values(self):
)
tm.assert_series_equal(actual, expected)

actual = to_timedelta(Series(["00:00:01", pd.NaT]))
with tm.assert_produces_warning(FutureWarning, match="Inferring timedelta64"):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you have some of the tests also assert NO warning if the data is not wrapped in a Series, e.g. just passed to to_timedelta or to_datetime for example should not warn and have the same result as the below.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated + green

Copy link
Contributor

Choose a reason for hiding this comment

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

might be worth doing for some calls to to_datetime as well (followon ok)

@jreback jreback merged commit b8ee68b into pandas-dev:master Jun 1, 2021
@jbrockmendel jbrockmendel deleted the depr-infer_to_datetimelike-2 branch June 1, 2021 15:59
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Constructors Series/DataFrame/Index/pd.array Constructors Deprecate Functionality to remove in pandas Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.array([timedelta_like_strings]) should infer TimedeltaArray
3 participants