Skip to content
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

Rolling Expr claims to support timedelta but doesn't appear to #19825

Closed
2 tasks done
CatchemAL opened this issue Nov 16, 2024 · 1 comment · Fixed by #19827
Closed
2 tasks done

Rolling Expr claims to support timedelta but doesn't appear to #19825

CatchemAL opened this issue Nov 16, 2024 · 1 comment · Fixed by #19827
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@CatchemAL
Copy link

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

    def rolling_std(
        self,
        window_size: int | timedelta,
        weights: list[float] | None = None,
        *,
        min_periods: int | None = None,
        center: bool = False,
        ddof: int = 1,
    ) -> Expr:

I'm aware that there are expressions such as rolling_std_by but many of the standard rolling expressions have type annotations suggesting they also support timedelta. Assuming they shouldn't, the following functions have type annotations that need correcting:

  • Expr.rolling_sum [src]
  • Expr.rolling_std [src]
  • Expr.rolling_var [src]
  • Expr.rolling_median [src]
  • Expr.rolling_quantile [src]
  • Expr.rolling_sum [src]

Log output

No response

Issue description

Type annotations appear to support timedelta but I am not convinced they do

Expected behavior

Probably just remove timedelta from annotations.

Installed versions

--------Version info---------
Polars: 1.12.0
Index type: UInt32
Platform: Linux-6.10.11-linuxkit-aarch64-with-glibc2.31
Python: 3.12.7 (main, Oct 2 2024, 00:14:14) [GCC 10.2.1 20210110]
LTS CPU: False

----Optional dependencies----
adbc_driver_manager
altair
cloudpickle
connectorx
deltalake
fastexcel
fsspec 2024.10.0
gevent
great_tables
matplotlib 3.9.2
nest_asyncio 1.6.0
numpy 2.1.2
openpyxl
pandas 2.2.3
pyarrow 17.0.0
pydantic
pyiceberg
sqlalchemy
torch 2.5.1
xlsx2csv
xlsxwriter

@CatchemAL CatchemAL added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Nov 16, 2024
@MarcoGorelli
Copy link
Collaborator

thanks @CatchemAL , I probably forgot to remove these when splitting things out into the _by variants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
2 participants