see https://github.com/pydata/pandas/pull/11972/files#r51353505 for a full test case