Skip to content

Conversation

loicdiridollou
Copy link
Member

Also dropped the locking of the version of beautifulsoup, it seems like they shipped another version that fixed the issue.

pyproject.toml Outdated
SQLAlchemy = ">=2.0.39"
types-python-dateutil = ">=2.8.19"
beautifulsoup4 = "<=4.13.5"
beautifulsoup4 = ">=4.13.5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
beautifulsoup4 = ">=4.13.5"
beautifulsoup4 = ">=4.14.2"

Comment on lines 948 to 951
o_s = cast(
"OffsetSeries", pd.Series([pd.DateOffset(days=1), pd.DateOffset(days=2)])
"pd.Series[BaseOffset]",
pd.Series([pd.DateOffset(days=1), pd.DateOffset(days=2)]),
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you see if we can create a Series.__new__() overload that would accept a sequence of BaseOffset so that we don't need the cast here?

Copy link
Member Author

Choose a reason for hiding this comment

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

So turns out this creates a Series[DateOffset] and not Series[BaseOffset] that is why this is an issue, not sure why though it is not working since it is supposed to inherit from BaseOffset.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I checked and seems like Series[DateOffset] does not match with Series[BaseOffset] even though DateOffset is always a BaseOffset:
assert_type(o_s, "pd.Series[BaseOffset]") ■ "assert_type" mismatch: expected "Series[BaseOffset]" but received "Series[DateOffset]"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you need to add an overload for Series.__new__() that accepts a sequence of BaseOffset and then it should work. Similar to how there are overloads that produce Series[Timestamp], Series[Timedelta], etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the to_numpy overloads and added the new overloads and it is looking good!

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

@Dr-Irv Dr-Irv merged commit 10fe362 into pandas-dev:main Sep 30, 2025
13 checks passed
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.

Remove PeriodSeries, OffsetSeries, IntervalSeries
2 participants