Skip to content

BUG: Styler copy methods not updated for recent additions #39708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
attack68 opened this issue Feb 9, 2021 · 1 comment · Fixed by #39975
Closed
3 tasks done

BUG: Styler copy methods not updated for recent additions #39708

attack68 opened this issue Feb 9, 2021 · 1 comment · Fixed by #39975
Assignees
Labels
Bug Copy / view semantics good first issue Regression Functionality that used to work in a prior pandas version Styler conditional formatting using DataFrame.style
Milestone

Comments

@attack68
Copy link
Contributor

attack68 commented Feb 9, 2021

  • 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.

@attack68 attack68 added Bug Needs Triage Issue that has not been reviewed by a pandas team member Styler conditional formatting using DataFrame.style Copy / view semantics good first issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 9, 2021
@attack68 attack68 added this to the Contributions Welcome milestone Feb 9, 2021
@rlukevie
Copy link
Contributor

take

rlukevie added a commit to rlukevie/pandas that referenced this issue Feb 22, 2021
@attack68 attack68 added the Regression Functionality that used to work in a prior pandas version label Mar 2, 2021
@jreback jreback modified the milestones: Contributions Welcome, 1.3 Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Copy / view semantics good first issue Regression Functionality that used to work in a prior pandas version Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants