Skip to content

Multiple fixes related to Timedelta and indexes - #177

Merged
Bill Schnurr (bschnurr) merged 1 commit into
microsoft:mainfrom
Dr-Irv:smallfixes
Mar 23, 2022
Merged

Bill Schnurr (bschnurr) merged 1 commit into
microsoft:mainfrom
Dr-Irv:smallfixes

Conversation

@Dr-Irv

Copy link
Copy Markdown
Contributor

Various fixes that were identified by applying pylance 2022.3.2 to our code:

  • Multiplication of a number and an untyped series keeps it untyped (was Series[Timedelta])
  • Multiplication of a series and Series[Timedelta] gives Series[Timedelta]
  • Series[Timestamp] minus Timedelta or Series[Timedelta] gives Series[Timestamp]
  • MultiIndex.astype returns MultiIndex
  • DataFrame.__setitem__ needs to accept IndexSlice as an argument on a single column
  • Series[Timedelta] plus DatetimeIndex is Series[Timestamp]
  • to_timedelta returns Series[Timedelta] when passed a Series
  • DatetimeIndex plus timedeltas is DatetimeIndex

Note: There are probably other arithmetic things we need to fix as well related to Timestamp and Timedelta

- Multiplication of a number and an untyped series keeps it untyped (was Series[Timedelta])
- Multiplicaiton of a series and Series[Timedelta] gives Series[Timedelta]
- Series[Timestamp] minus Timedelta or Series[Timedelta] gives Series[Timestamp]
- MultiIndex.astype returns MultiIndex
- DataFrame.__setitem__ needs to accept IndexSlice as an argument on a single column
- Series[Timedelta] plus DatetimeIndex is Series[Timestamp]
- to_timedelta returns Series[Timedelta] when passed a Series
- DatetimeIndex plus timedeltas is DatetimeIndex
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.

2 participants