Skip to content

Commit

Permalink
fix: enforce recomputation of description sets
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarros authored and vascoalramos committed Dec 21, 2022
1 parent 676a799 commit 97a9c83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pandas_profiling/compare_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def _apply_config(description: dict, config: Settings) -> dict:
def compare(
reports: List[ProfileReport],
config: Optional[Settings] = None,
compute: bool = True,
) -> ProfileReport:
"""
Compare Profile reports
Expand All @@ -231,6 +232,7 @@ def compare(
reports: two reports to compare
input may either be a ProfileReport, or the summary obtained from report.get_description()
config: the settings object for the merged ProfileReport
compute: recompute the profile report using config or the left report config
"""
validate_reports(reports)
Expand All @@ -243,7 +245,7 @@ def compare(
return reports[0]

if config is None:
_config = Settings()
_config = reports[0].config.copy()
else:
_config = config.copy()
for report in reports:
Expand All @@ -252,6 +254,8 @@ def compare(
report.config = config.copy()
report.config.title = title
report.config.vars.timeseries.active = tsmode
if compute:
report._description_set = None

if all(isinstance(report, ProfileReport) for report in reports):
# Type ignore is needed as mypy does not pick up on the type narrowing
Expand Down

0 comments on commit 97a9c83

Please sign in to comment.