ToArrowRecordBatches accumulates arrays from previous batches, producing invalid record batches
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 62/100
調査の方向性
バグは src/Microsoft.Data.Analysis/DataFrame.Arrow.cs の ToArrowRecordBatches() にあり、arrays リストがバッチ分割ループの外で宣言されたまま、一度もリセットされていません。そのループを読んでから、再現手順を DataFrame.FromArrowRecordBatch と照らし合わせて確認してください。各バッチに自身の列配列だけが含まれ、再現手順のバッチ 1 が 42 を含む 1 行 1 列のフレームとして再インポートされれば完了です。拡張すべきテストは、Arrow のラウンドトリップに関する Microsoft.Data.Analysis のテストにあります。
索引モデルが issue の本文から書いたものです。
説明
Description
DataFrame.ToArrowRecordBatches() accumulates arrays from previous batches. A one-column DataFrame exports its second record batch with one schema field but two arrays, including the first batch's stale array.
This invalid batch cannot be imported using DataFrame.FromArrowRecordBatch(), which throws ArgumentOutOfRangeException.
Reproduced on Microsoft.Data.Analysis 0.23.0, Apache.Arrow 14.0.2, Windows x64, .NET 10. The reproduction uses only public, high-level DataFrame APIs and is independent of Arrow string null-count bugs (https://github.com/dotnet/machinelearning/issues/7800 and https://github.com/dotnet/machinelearning/issues/7801).
Reproduction
Create a console app, add Microsoft.Data.Analysis version 0.23.0, and run:
using System;
using System.Linq;
using Microsoft.Data.Analysis;
var numbers = new Int64DataFrameColumn("numbers");
numbers.AppendMany(42, 268_304_384);
var frame = new DataFrame(numbers);
var batches = frame.ToArrowRecordBatches();
foreach (var (i, batch) in batches.Index())
{
Console.WriteLine(
$"Batch {i}: rows={batch.Length}; fields={batch.Schema.FieldsList.Count}; arrays={batch.Arrays.Count()}; array lengths=[{string.Join(", ", batch.Arrays.Select(array => array.Length))}]");
try
{
var roundTrip = DataFrame.FromArrowRecordBatch(batch);
Console.WriteLine($"Reimported batch {i}: rows={roundTrip.Rows.Count}; columns={roundTrip.Columns.Count}");
}
catch (ArgumentOutOfRangeException e)
{
Console.WriteLine($"Reimporting batch {i}: {e.GetType().Name}: {e.Message}");
}
}
Requires slightly over 2 GB for the numeric buffers and validity bitmaps. The row count naturally creates two numeric buffers and forces two record batches.
Actual output
Batch 0: rows=268304383; fields=1; arrays=1; array lengths=[268304383]
Reimported batch 0: rows=268304383; columns=1
Batch 1: rows=1; fields=1; arrays=2; array lengths=[268304383, 1]
Reimporting batch 1: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
Expected behavior
Each batch should contain exactly one array matching its single schema field. Batch 1 should contain only its one-row array, and reimport should produce a one-row, one-column DataFrame containing 42.
Cause
DataFrame.ToArrowRecordBatches() creates the arrays list outside its batching loop and continually appends each batch's arrays without resetting that list.
Each record batch should receive a fresh per-batch collection containing only the current batch's column arrays. Also ensure that continuing enumeration cannot mutate an already yielded batch.
- 主要言語
- C#
- スター
- 9.4k
- フォーク
- 2k
- 平均マージ
- 3日 8時間
- マージ済み PR(30日)
- 41
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/machinelearning のほかの issue
-
LlamaTokenizer encodes some runs of repeated characters differently from SentencePiece対応中かも @Laurianti が 15 日前に担当しました。 オープンuntriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
dotnet/machinelearning#7751 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
BertTokenizer merges words separated only by `\n`, `\t` or `\r`対応中かも @rosebyte が 23 日前に担当しました。 オープンarea-Tokenizers green
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
dotnet/machinelearning#7724 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
area-TimeSeries documentation untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
dotnet/machinelearning#7205 ·
メンテナーはふだん 2 日以内に返信
-
area-ONNX documentation Priority:3
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
dotnet/machinelearning#5894 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Add a .vsconfig fileオープンarea-Infrastructure Priority:2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dotnet/machinelearning#3260 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
dotnet/machinelearning の issue をすべて見る
似ている issue
-
ASP.NET Core container quickstart: `docker-run: debug` task sample is missing its closing braceオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/vscode-docs#10499 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/semantic-kernel#14615 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vzeol/DeployCraft#125 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/arrow-adbc#4915 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信