Closed
Description
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
(optional) I have confirmed this bug exists on the master branch of pandas.
Recent additions (1.2.0) (1.3.0) to Styler
have introduced additional class attributes.
The existing copy
mechanisms catered for older attributes (although not all), but now needs to be reviewed.
Tests should probably be added.
def _copy(self, deepcopy: bool = False) -> Styler:
styler = Styler(
self.data,
precision=self.precision,
caption=self.caption,
uuid=self.uuid,
table_styles=self.table_styles,
na_rep=self.na_rep,
)
if deepcopy:
styler.ctx = copy.deepcopy(self.ctx)
styler._todo = copy.deepcopy(self._todo)
else:
styler.ctx = self.ctx
styler._todo = self._todo
return styler
And it might also be worth reviewing the export
and use
styles methods in case something has been missed.