Skip to content

[ENH] Add Polars Support #28

Description

@imann128

Request

Add support for Polars DataFrames alongside the existing pandas implementation,
So users working in Polars-native pipelines can use tsauditor without converting
to pandas first.

Current state

tsauditor is currently pandas-native throughout. Every module assumes:

  • a pd.DataFrame input
  • a pd.DatetimeIndex as the time index
  • pandas-specific operations (.rolling(), .diff(), .groupby(), .iloc[])

What this would involve

At minimum, one of:

  • A conversion layer at the scan() entry point that accepts a Polars DataFrame
    and converts to pandas internally before passing to modules
  • A parallel Polars-native implementation of each audit module

The conversion-layer approach is simpler and probably the right starting point.
It keeps the core detection logic unchanged while broadening input compatibility.

Notes for contributors

This is a non-trivial addition. A good starting point would be:

  1. Opening a discussion comment here on the preferred approach (conversion vs native)
  2. Adding polars as an optional dependency in pyproject.toml
  3. Implementing and testing the conversion layer in tsauditor/utils/validation.py
    where input validation already lives

If you're interested in taking this on, comment here so we can avoid duplicate work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions