Skip to content

Commit 97a9c83

Browse files
alexbarrosvascoalramos
authored andcommitted
fix: enforce recomputation of description sets
1 parent 676a799 commit 97a9c83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pandas_profiling/compare_reports.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def _apply_config(description: dict, config: Settings) -> dict:
223223
def compare(
224224
reports: List[ProfileReport],
225225
config: Optional[Settings] = None,
226+
compute: bool = True,
226227
) -> ProfileReport:
227228
"""
228229
Compare Profile reports
@@ -231,6 +232,7 @@ def compare(
231232
reports: two reports to compare
232233
input may either be a ProfileReport, or the summary obtained from report.get_description()
233234
config: the settings object for the merged ProfileReport
235+
compute: recompute the profile report using config or the left report config
234236
235237
"""
236238
validate_reports(reports)
@@ -243,7 +245,7 @@ def compare(
243245
return reports[0]
244246

245247
if config is None:
246-
_config = Settings()
248+
_config = reports[0].config.copy()
247249
else:
248250
_config = config.copy()
249251
for report in reports:
@@ -252,6 +254,8 @@ def compare(
252254
report.config = config.copy()
253255
report.config.title = title
254256
report.config.vars.timeseries.active = tsmode
257+
if compute:
258+
report._description_set = None
255259

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

0 commit comments

Comments
 (0)