queryverse / queryverse/StatFiles.jl
SAS XPORT (.xpt) and SPSS portable (.por) files are not loadable through FileIO
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 27
- Forks
- 8
- Avg merge
- 15h 51m
- Merged PRs (30d)
- 4
Description
Found while auditing the ReadStat stack (see #31).
Two formats ReadStat can read are not reachable from load():
.por is half-wired. IteratorInterfaceExtensions.getiterator dispatches on the extension and calls read_por for .por (src/StatFiles.jl:58-59), but FileIO's registry only registers format"Stata" (.dta), format"SPSS" (.sav, magic $FL2) and format"SAS" (.sas7bdat) against StatFiles. There is no format or fileio_load method for .por, so load("x.por") never reaches the branch that would handle it. The .por branch is only reachable by constructing a StatFile directly.
.xpt is not wired at all. ReadStat has exported read_xport since v1.1.0 and has a types.xpt fixture, but StatFiles has no format registration, no fileio_load method, and no getiterator branch for it.
Fixing either means adding a format to FileIO's central registry (FileIO/src/registry.jl) as well as a fileio_load method here, so it needs an upstream FileIO PR alongside the StatFiles change. Note SPSS portable files are text-based with a 200-byte header, so the magic-byte approach used for .sav may not transfer directly.
Also worth noting: test/types.por is already checked in but no test exercises it.
🤖 Generated with Claude Code
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/StatFiles.jl:58-59 and the existing FileIO methods, then inspect FileIO/src/registry.jl for the central format registrations. Use test/types.por and the existing types.xpt fixture to understand coverage, and verify that load() reaches both formats rather than only direct StatFile construction. Done means the supported extensions are registered, load methods and iterator dispatch cover them, and tests exercise the FileIO paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100