Skip to content

Fix tuple-typed function args being exploded in extraction#30

Open
bastianhagedorn wants to merge 1 commit intomainfrom
bhagedorn/fix-tuple-arg-explode
Open

Fix tuple-typed function args being exploded in extraction#30
bastianhagedorn wants to merge 1 commit intomainfrom
bhagedorn/fix-tuple-arg-explode

Conversation

@bastianhagedorn
Copy link
Collaborator

Fix tuple-typed function args being exploded in extraction

df.apply(pd.Series.explode) in extraction.py explodes all columns, including tuple-typed function arguments (e.g. mnkl=(8192,8192,8192,1), tile_shape=(128,256,64)). When two tuple args have different lengths, this crashes with ValueError: cannot reindex on an axis with duplicate labels. With matching lengths, data is silently corrupted.

Fix

Replace df.apply(pd.Series.explode) with df.explode(["Value", "Metric"]) so only the metric data columns are exploded.

Tests

  • test_tuple_typed_function_args — single metric, two tuple args of different lengths
  • test_tuple_typed_function_args_multiple_metrics — 3 metrics, tuple args with 4 and 2 elements, verifies exactly 3 rows produced with tuples preserved

When a decorated function has tuple-typed arguments (e.g. mnkl, tile_shape),
pd.Series.explode was applied to all DataFrame columns, unintentionally
exploding those arg columns. When two tuple args had different lengths,
this caused a ValueError. With matching lengths, data was silently corrupted.

Replace df.apply(pd.Series.explode) with df.explode(["Value", "Metric"])
to only explode the columns that contain per-metric data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 6, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@bastianhagedorn
Copy link
Collaborator Author

/ok to test 1950793

@acollins3 acollins3 self-requested a review March 6, 2026 13:21
@acollins3
Copy link
Collaborator

lgtm. Just need to fix those lint failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants