I had the same issue.
Just add .reset_index() at the end of your dataframe or add df = df.reset_index() before you write your dataset.