Open
Description
When checking and fixing column names for writing a Stata file, there is an added check to see whether the renamed column also needs to be renamed under the _convert_dates class attribute (a dict). However, there is a missing condition to see if the renamed column name is actually listed under the _convert_dates dict, and so it raises KeyError every time such variable name is not found in the dict keys. A simple condition such as that below would probably do the trick:
if c != o and o in self._convert_dates:
Line 2614 in ca91dd4