@@ -1165,28 +1165,13 @@ def test_categorical_writing(self, version, temp_file):
1165
1165
1166
1166
def test_categorical_warnings_and_errors (self , temp_file ):
1167
1167
# Warning for non-string labels
1168
- # Error for labels too long
1169
- original = DataFrame .from_records (
1170
- [["a" * 10000 ], ["b" * 10000 ], ["c" * 10000 ], ["d" * 10000 ]],
1171
- columns = ["Too_long" ],
1172
- )
1173
-
1174
- original = original .astype ("category" )
1175
- path = temp_file
1176
- msg = (
1177
- "Stata value labels for a single variable must have "
1178
- r"a combined length less than 32,000 characters\."
1179
- )
1180
- with pytest .raises (ValueError , match = msg ):
1181
- original .to_stata (path )
1182
-
1183
1168
original = DataFrame .from_records (
1184
1169
[["a" ], ["b" ], ["c" ], ["d" ], [1 ]], columns = ["Too_long" ]
1185
1170
).astype ("category" )
1186
1171
1187
1172
msg = "data file created has not lost information due to duplicate labels"
1188
1173
with tm .assert_produces_warning (ValueLabelTypeMismatch , match = msg ):
1189
- original .to_stata (path )
1174
+ original .to_stata (temp_file )
1190
1175
# should get a warning for mixed content
1191
1176
1192
1177
@pytest .mark .parametrize ("version" , [114 , 117 , 118 , 119 , None ])
0 commit comments