Quantco / Quantco/dataframely

Adding `sorted` in `dy.Column`

Open
#357 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
618
Forks
21
Avg merge
14h 34m
Merged PRs (30d)
7

Description

Polars 1.42+ provides pl.Expr.is_sorted() which returns a boolean indicating whether the column is sorted.

It could be nice that this check could be define in a dataframely schema without needing a custom check.

Implementation:sorted could take 3 values: "ascending", "descending" and "None" (the default). The polars implementation takes as well a nulls_last argument, maybe we shouldn't include this complexity here and user could use a custom check if the position of nulls maters. WDYT ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating dy.Column and the existing column-constraint or custom-check entry points, then read Polars' pl.Expr.is_sorted() behavior. The work is complete when the schema can express the proposed sorted values and tests cover ascending, descending, and the default behavior, including the stated null-ordering scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.