I had just ran into the same error, and for me the issue was that the column names were integers and not strings. so then the dictionary created in
columns=[{'name': i, 'id': i,} for i in df.columns]
gets an error because it will read {‘name’: 2013, ‘id’: ‘2013’} and not {‘name’: ‘2013’, ‘id’: ‘2013’}.