Commit cb5fc60
committed
BUG: Fixed incorrect string length calculation when writing strings to Stata
Strings were incorrectly written using 244 character irrespective of the actual
length of the underlying due to changes in pandas where the underlying NumPy
datatype of strings is always np.object_, and never np.string_. Closes #7858
String types were also not being checked for excessive length, and DataFrames
with strings containing more then 244 characters were producing invalid
dta files. Attempting to write long strings raises an error now.1 parent 0621f9f commit cb5fc60
File tree
4 files changed
+62
-4
lines changed- doc/source
- pandas/io
- tests
4 files changed
+62
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3529 | 3529 | | |
3530 | 3530 | | |
3531 | 3531 | | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
3532 | 3539 | | |
3533 | 3540 | | |
3534 | 3541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| |||
312 | 317 | | |
313 | 318 | | |
314 | 319 | | |
315 | | - | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
| |||
1040 | 1046 | | |
1041 | 1047 | | |
1042 | 1048 | | |
1043 | | - | |
| 1049 | + | |
1044 | 1050 | | |
1045 | 1051 | | |
1046 | 1052 | | |
1047 | 1053 | | |
1048 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
1049 | 1057 | | |
1050 | 1058 | | |
1051 | 1059 | | |
| |||
1055 | 1063 | | |
1056 | 1064 | | |
1057 | 1065 | | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1058 | 1069 | | |
1059 | 1070 | | |
1060 | | - | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1061 | 1081 | | |
1062 | 1082 | | |
1063 | 1083 | | |
| |||
1264 | 1284 | | |
1265 | 1285 | | |
1266 | 1286 | | |
1267 | | - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
1268 | 1290 | | |
1269 | 1291 | | |
1270 | 1292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
568 | 592 | | |
569 | 593 | | |
570 | 594 | | |
| |||
0 commit comments