Skip to content

Inconsistent Date.mean() between streaming and in-memory #29357

Description

@dancsi

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

import polars as pl

lf = pl.LazyFrame({"a": pl.Series([20000, 20000, 20000, 20000, 20003], dtype=pl.Int32)}).select(
    pl.col("a").cast(pl.Date)
)
q = lf.select(pl.col("a").mean())
print(q.collect(engine="in-memory").item())  # 2024-10-04 14:23:59.999999
print(q.collect(engine="streaming").item())  # 2024-10-04 14:24:00

Log output

Issue description

Different output

Expected behavior

Same output

Installed versions

Details
--------Version info---------
Polars:              2.0.0-rc.1
Build:               <unknown>
Index type:          UInt32
Platform:            macOS-26.6.2-arm64-arm-64bit-Mach-O
Python:              3.14.7 (main, Aug  5 2026, 10:29:49) [Clang 21.0.0 (clang-2100.1.1.101)]
Runtime:             rt32

----Optional dependencies----
Azure CLI            <not installed>
adbc_driver_manager  1.12.0
altair               6.3.0
azure.identity       1.25.3
boto3                1.43.75
cloudpickle          3.1.2
connectorx           0.4.5
deltalake            1.6.3
fastexcel            0.21.0
fsspec               2026.7.0
gevent               26.8.0
google.auth          2.58.0
great_tables         0.24.0
matplotlib           3.11.2
numpy                2.5.3
openpyxl             3.1.5
pandas               3.0.5
polars_cloud         0.11.2
pyarrow              25.0.1
pydantic             2.13.5
pyiceberg            0.12.0
sqlalchemy           2.0.53
torch                <not installed>
xlsx2csv             0.8.6
xlsxwriter           3.2.9

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-streamingRelated to the streaming enginebugSomething isn't workingneeds triageAwaiting prioritization by a maintainerpythonRelated to Python Polars

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions