Skip to content

Commit 38e93e0

Browse files
cmjcharltonmroeschke
authored andcommitted
TST: Add tests for reading Stata dta files saved in big-endian format (pandas-dev#58195)
* TST: Add tests for reading Stata dta files saved in big-endian format * Update pandas/tests/io/test_stata.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 83b9269 commit 38e93e0

7 files changed

+9
-0
lines changed
771 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

pandas/tests/io/test_stata.py

+9
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,15 @@ def test_backward_compat(version, datapath):
20042004
tm.assert_frame_equal(old_dta, expected, check_dtype=False)
20052005

20062006

2007+
@pytest.mark.parametrize("version", [105, 108, 111, 113, 114, 118])
2008+
def test_bigendian(version, datapath):
2009+
ref = datapath("io", "data", "stata", f"stata-compat-{version}.dta")
2010+
big = datapath("io", "data", "stata", f"stata-compat-be-{version}.dta")
2011+
expected = read_stata(ref)
2012+
big_dta = read_stata(big)
2013+
tm.assert_frame_equal(big_dta, expected)
2014+
2015+
20072016
def test_direct_read(datapath, monkeypatch):
20082017
file_path = datapath("io", "data", "stata", "stata-compat-118.dta")
20092018

0 commit comments

Comments
 (0)