[Feature Request] Add support for clipping values during type enforcement
まだ誰も着手していません。
評価
調査の方向性
この issue ではファイルやテストが指定されていないため、まず schema enforcement と casting のエントリーポイントを見つけ、次に数値 dtype の範囲がどのように扱われているかを調べます。out_of_bounds="clip" のようなオプションによって、既存のデフォルト動作を変更せずに値が対象型の最小値と最大値に収まるようになれば、機能は完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 618
- フォーク
- 21
- 平均マージ
- 14時間 34分
- マージ済み PR(30日)
- 7
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Quantco/dataframely のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Quantco/dataframely#402 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
Quantco/dataframely#357 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Quantco/dataframely#309 · コメント 4 件 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
Quantco/dataframely#295 · コメント 3 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Quantco/dataframely#272 · コメント 10 件 · リアクション 1 件 ·
Quantco/dataframely の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100