-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
@@ -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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 | |||
|
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated per request
There was a problem hiding this 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
There was a problem hiding this 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): |
There was a problem hiding this comment.
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
can you rebase |
rebased+green |
|
once more rebase |
name: Optional[str] = None, | ||
) -> ABCIndexClass: | ||
) -> "Index": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quotes no longer needed?
There was a problem hiding this comment.
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
thanks! can you edit the deprecations removal issue for this change as well (not sure if you did) |
No description provided.