Skip to content

REF: separate to_time, avoid runtime imports #34145

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 9 commits into from
May 18, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

@@ -156,7 +159,7 @@ def _maybe_cache(arg, format, cache, convert_listlike):

def _box_as_indexlike(
dt_array: ArrayLike, utc: Optional[bool] = None, name: Optional[str] = None
) -> Union[ABCIndex, ABCDatetimeIndex]:
) -> Index:
Copy link
Member Author

Choose a reason for hiding this comment

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

@simonjayhawkins do we have a way of annotating a return type is either an Index or DatetimeIndex, but no other Index subclass?

Copy link
Member

Choose a reason for hiding this comment

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

not that i'm aware of. If Index subclasses obey Liskov, shouldn't be an issue. why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

why is this needed?

Not "needed", but i guess its a more-specific-is-better thing

@@ -942,133 +933,3 @@ def calc_with_mask(carg, mask):
pass

return None

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 leave to_time here and show a FutureWarning (I know at least ibis is using this)

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 per request

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

i think would be ok in exposing pd.to_time as well

@jreback jreback added Clean Deprecate Functionality to remove in pandas Datetime Datetime data dtype labels May 12, 2020
@jreback jreback added this to the 1.1 milestone May 12, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. small followon comment, also can you open an issue about exposing pd.to_time

datetime.time
"""

def _convert_listlike(arg, format):
Copy link
Contributor

Choose a reason for hiding this comment

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

in followon can make this a module level function

@jreback
Copy link
Contributor

jreback commented May 17, 2020

can you rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@mroeschke
Copy link
Member

also can you open an issue about exposing pd.to_time

#11947

@jreback
Copy link
Contributor

jreback commented May 18, 2020

once more rebase

name: Optional[str] = None,
) -> ABCIndexClass:
) -> "Index":
Copy link
Member

Choose a reason for hiding this comment

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

quotes no longer needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch. will edit in follow-up

@jreback jreback merged commit 239b6a7 into pandas-dev:master May 18, 2020
@jreback
Copy link
Contributor

jreback commented May 18, 2020

thanks!

can you edit the deprecations removal issue for this change as well (not sure if you did)

@jbrockmendel jbrockmendel deleted the cln-tools-runtime branch May 18, 2020 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Datetime Datetime data dtype Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants