Skip to content

BUG: StataWriter uses incorrect string length #8977

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
Dec 3, 2014

Conversation

bashtage
Copy link
Contributor

@bashtage bashtage commented Dec 3, 2014

Fixes bug where StataWriter always writes strings with
a size of 244.

closes #8969

@bashtage
Copy link
Contributor Author

bashtage commented Dec 3, 2014

@jreback I have had to use a workaround since max_len_string_array does not work with unicode - it alway returns 0. Any ideas on getting the maximum length for a unicode array (when infer_dtype returns 'unicode')?

@jreback
Copy link
Contributor

jreback commented Dec 3, 2014

#8978

should fix this (give it a try and lmk)

just wasn't implemented.

@jreback jreback added Bug Output-Formatting __repr__ of pandas objects, to_string IO Stata read_stata, to_stata labels Dec 3, 2014
@jreback jreback added this to the 0.15.2 milestone Dec 3, 2014
@bashtage
Copy link
Contributor Author

bashtage commented Dec 3, 2014

Once #8978 gets in, then I'll rebase and remove the workaround.

@jreback
Copy link
Contributor

jreback commented Dec 3, 2014

does that fix it for you? it's ready to go

@bashtage
Copy link
Contributor Author

bashtage commented Dec 3, 2014

Yes, all fixed. Once I can rebase on it this should be ready.

Fixes bug where StataWriter always writes strings with
a size of 244.

closes pandas-dev#8969
@bashtage bashtage force-pushed the stata-writer-string-length branch from 823c238 to 3872a6e Compare December 3, 2014 11:43
@jreback
Copy link
Contributor

jreback commented Dec 3, 2014

did you need any addtl tests for this? looks back-compat?

@bashtage
Copy link
Contributor Author

bashtage commented Dec 3, 2014

I adapted an existing test to check for this in addition to a previous bug

On Dec 3, 2014 8:32 AM, jreback [email protected] wrote:

did you need any addtl tests for this? looks back-compat?


Reply to this email directly or view it on GitHubhttps://github.com//pull/8977#issuecomment-65406670.

jreback added a commit that referenced this pull request Dec 3, 2014
BUG: StataWriter uses incorrect string length
@jreback jreback merged commit fe8509b into pandas-dev:master Dec 3, 2014
@jreback
Copy link
Contributor

jreback commented Dec 3, 2014

thanks!

@bashtage bashtage deleted the stata-writer-string-length branch January 18, 2015 22:42
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 Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_stata always stores strings as str244
2 participants