Skip to content

BUG: Fixed failure in StataReader when reading variable labels in 117 #7818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2014

Conversation

bashtage
Copy link
Contributor

Stata's implementation does not match the online dta file format description.
The solution used here is to directly compute the offset rather than reading
it from the dta file. If Stata fixes their implementation, the original code
can be restored.
closes #7816

@jreback jreback added this to the 0.15.0 milestone Jul 22, 2014
@jreback
Copy link
Contributor

jreback commented Jul 22, 2014

anyway to include a test file? (small one)

@bashtage
Copy link
Contributor Author

I haven't added a test yet, but will do.

@bashtage
Copy link
Contributor Author

@jreback Test added, so if no typos and all pass, should be ready

@@ -551,6 +554,18 @@ def test_bool_uint(self):
written_and_read_again = written_and_read_again.set_index('index')
tm.assert_frame_equal(written_and_read_again, expected)

def test_variable_labels(self):
sr_115 = StataReader(self.dta16_115).variable_labels()
sr_117 = StataReader(self.dta16_115).variable_labels()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this not be the other file?

@bashtage
Copy link
Contributor Author

I think it is ready now.

@jreback
Copy link
Contributor

jreback commented Jul 22, 2014

ok, ping when green

@bashtage
Copy link
Contributor Author

Strange, a failure in a file I didn't change.

@jreback
Copy link
Contributor

jreback commented Jul 22, 2014

I think that was fixed
are you rebased against master?

… files

Stata's implementation does not match the online dta file format description.
The solution used here is to directly compute the offset rather than reading
it from the dta file.  If Stata fixes their implementation, the original code
can be restored.
closes pandas-dev#7816
@bashtage
Copy link
Contributor Author

Rebased

@jreback
Copy link
Contributor

jreback commented Jul 23, 2014

these look like small test files you created, yes? (which is good)

jreback added a commit that referenced this pull request Jul 23, 2014
BUG: Fixed failure in StataReader when reading variable labels in 117
@jreback jreback merged commit 0cff907 into pandas-dev:master Jul 23, 2014
@jreback
Copy link
Contributor

jreback commented Jul 23, 2014

@bashtage thanks for the fix!

@bashtage bashtage deleted the stata-117-variable-labels branch August 20, 2014 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Stata read_stata, to_stata
Projects
None yet
2 participants