Skip to content

Commit d067e08

Browse files
authored
BUG: Fix stata bug post pre-commit update (#60476)
1 parent d9dfaa9 commit d067e08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/io/stata.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2207,14 +2207,14 @@ def _convert_datetime_to_stata_type(fmt: str) -> np.dtype:
22072207
def _maybe_convert_to_int_keys(convert_dates: dict, varlist: list[Hashable]) -> dict:
22082208
new_dict = {}
22092209
for key, value in convert_dates.items():
2210-
if not value.startswith("%"): # make sure proper fmts
2210+
if not convert_dates[key].startswith("%"): # make sure proper fmts
22112211
convert_dates[key] = "%" + value
22122212
if key in varlist:
2213-
new_dict[varlist.index(key)] = value
2213+
new_dict[varlist.index(key)] = convert_dates[key]
22142214
else:
22152215
if not isinstance(key, int):
22162216
raise ValueError("convert_dates key must be a column or an integer")
2217-
new_dict[key] = value
2217+
new_dict[key] = convert_dates[key]
22182218
return new_dict
22192219

22202220

0 commit comments

Comments
 (0)