Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Feature Request] Add support for clipping values during type enforcement

Open
#273 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
data

Research direction

The issue does not name files or tests; start by locating the schema enforcement and casting entry point, then inspect how numeric dtype bounds are handled. The feature is done when an option such as out_of_bounds="clip" bounds values to the target type's minimum and maximum without changing existing behavior by default.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

Currently, when enforcing a schema where data exceeds the range of the target dtype (e.g., a value of 260 for a uint8 column), the operation may fail or lead to silent overflows. In production environments, it is often preferable to bound these values rather than allowing the pipeline to crash or produce corrupted data.

Describe the solution you'd like

I would like to see an option—perhaps a parameter like out_of_bounds="clip"—within the schema enforcement logic. When enabled, any value exceeding the maximum or minimum of the target numeric type would be clipped to that type's limit.

Example Scenario

Target Dtype: uint8 (Range: 0 to 255)

Input Value: 260

Expected Result (with clipping): 255

Describe alternatives you've considered

The current alternative is to manually call .clip() on the DataFrame before validation, but this duplicates logic that could be handled more efficiently during the schema enforcement/casting phase.

Dominant language
Python
Stars
618
Forks
21
Avg merge
15h 53m
Merged PRs (30d)
8

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

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.

More from Quantco/dataframely

All issues in Quantco/dataframely

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.