FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: Improve error for FITS tables with too many columns by CAOShurong · Pull Request #20234 · astropy/astropy · GitHub

BUG: Improve error for FITS tables with too many columns - #20234

Open
CAOShurong wants to merge 3 commits into
astropy:mainfrom
CAOShurong:codex/fits-column-limit-error
Open

BUG: Improve error for FITS tables with too many columns#20234
CAOShurong wants to merge 3 commits into
astropy:mainfrom
CAOShurong:codex/fits-column-limit-error

Conversation

Copy link
Copy Markdown

Description

FITS binary tables are limited to 999 columns. Writing a larger Table currently reaches HDU construction before that limit is reported, which can emit non-standard TTYPE1000/TFORM1000 warnings before ending with the generic message that TFIELDS is invalid.

This change checks the encoded table's physical column count before constructing the HDU and raises a specific VerifyError. The check happens after mixin encoding so expanded mixin columns are included.

The regression tests cover both sides of the boundary: 999 columns still write successfully, while 1000 columns raise the clear error.

Fixes #19236

Validation

  • python -m pytest astropy/io/fits/tests/test_connect.py -q (176 passed, 8 skipped)
  • python -m pytest astropy/io/fits -q -n 4 (1661 passed, 39 skipped, 100 xfailed)
  • python -m pre_commit run --files astropy/io/fits/connect.py astropy/io/fits/tests/test_connect.py
  • Built a Windows CPython 3.13 wheel and installed it into a clean virtual environment
  • From that installed wheel, wrote and read back a 999-column FITS file; a 1000-column write raised the new VerifyError and left no output file

AI disclosure

OpenAI Codex assisted with issue triage, implementation, and local validation. The contributor remains responsible for the submitted content and will engage with review feedback.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

pllim added this to the v8.1.0 milestone Aug 13, 2026
Comment thread docs/changes/io.fits/20234.bugfix.rst Outdated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message for FITS table with too many columns

2 participants


Back | FazBrowse Home | New Git URL