Skip to content

Conversation

@loicdiridollou
Copy link
Member

  • Closes More defaults need to be set #1317
  • Tests added (Please use assert_type() to assert the type of any return value)
  • If I used AI to develop this pull request, I prompted it to follow AGENTS.md.

Following the work of @MarcoGorelli in #1318

def map(self, mapper): ...
def to_dense(self): ...
def nonzero(self): ...
def all(self, axis=..., *args: Any, **kwargs: Any): ...
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def all(self, axis=..., *args: Any, **kwargs: Any): ...
def all(self, axis: AxisInt = 0, *args: Any, **kwargs: Any): ...

sortorder: int | None = None,
names: SequenceNotStr[Hashable] | None = None,
copy: bool = False,
name: SequenceNotStr[Hashable] | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: SequenceNotStr[Hashable] | None = None,
name: None = None,

Kept for compatibility with 1-dimensional Index. Should not be used.

self,
freq: Frequency | None,
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = ...,
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = "raise",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ambiguous: Literal["raise", "infer", "NaT"] | bool | np_ndarray_bool = "raise",
ambiguous: TimeAmbiguous = "raise",

and also for the other two cases

Comment on lines 184 to +188
nonexistent: (
Literal["shift_forward", "shift_backward", "NaT", "raise"]
| timedelta
| Timedelta
) = ...,
) = "raise",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nonexistent: (
Literal["shift_forward", "shift_backward", "NaT", "raise"]
| timedelta
| Timedelta
) = ...,
) = "raise",
nonexistent: TimeNonexistent = "raise"

and also for the other two cases

def to_pydatetime(self) -> np_1darray_object: ...
def std(
self, axis: int | None = ..., ddof: int = ..., skipna: bool = ...
self, axis: int | None = None, ddof: int = 1, skipna: bool = True
Copy link
Contributor

Choose a reason for hiding this comment

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

https://pandas.pydata.org/docs/dev/reference/api/pandas.DatetimeIndex.std.html

Suggested change
self, axis: int | None = None, ddof: int = 1, skipna: bool = True
self, axis: int | None = None, ddof: int = 1, keepdims: bool | None = False, skipna: bool = True

Comment on lines -317 to -326
@overload
def __new__(
cls,
data: DatetimeIndex,
*,
dtype: TimestampDtypeArg | None = ...,
copy: bool = ...,
name: Hashable = ...,
tupleize_cols: bool = ...,
) -> DatetimeIndex: ...
Copy link
Contributor

Choose a reason for hiding this comment

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

Why removing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More defaults need to be set

2 participants