Skip to content

Preserve columns matching the first header during transpose - #682

Open
Tamako-C wants to merge 1 commit into
jazzband:masterfrom
Tamako-C:fix/transpose-repeated-first-header
Open

Tamako-C wants to merge 1 commit into
jazzband:masterfrom
Tamako-C:fix/transpose-repeated-first-header

Conversation

@Tamako-C

@Tamako-C Tamako-C commented Sep 7, 2026

Copy link
Copy Markdown

Dataset.transpose() currently skips every column whose header matches the first header. Only the first column belongs in the new header row; later columns with the same name must still become data rows.

Skip the first column by position. Add regression tests for a repeated first header and for the case where an original cell value matches the first header, causing data loss after two transposes.

This addresses the remaining case reported by punchagan in #199 (comment). The earlier PR #199 is already merged; this is a follow-up fix.

Validation:

  • Both regression tests fail against the original source and pass after the fix.
  • Full suite on Python 3.12.14 with pandas 3.0.1 and all required format dependencies: 185 passed with process-local TZ=UTC, without skipped tests.
  • In the host's UTC+8 timezone: 184 passed and one existing date-conversion test failed. Running that same test against the original HEAD reproduces the failure; it matches Fix timezone-dependent getDate timestamp test #675. No system timezone or test expectations were changed.
  • Changed Python files pass local Ruff 0.11.9. After submission, pre-commit.ci passed using the repository's configuration, which pins Ruff 0.15.20.
  • git diff --check passes.

AI assistance: OpenAI Codex assisted with the implementation, regression tests, and this PR description.

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.

1 participant