Skip to content

fix(report): add helpful migration errors for save_html/save_json/json in 0.7+#1850

Open
RaghavShah01 wants to merge 1 commit intoevidentlyai:mainfrom
RaghavShah01:fix/report-migration-error-messages
Open

fix(report): add helpful migration errors for save_html/save_json/json in 0.7+#1850
RaghavShah01 wants to merge 1 commit intoevidentlyai:mainfrom
RaghavShah01:fix/report-migration-error-messages

Conversation

@RaghavShah01
Copy link
Copy Markdown

Fixes #1595

Users on Evidently 0.7+ get a cryptic error with no guidance:

AttributeError: 'Report' object has no attribute 'save_html'

Root cause: In 0.7, report.run() returns a Snapshot object.
save_html, save_json, and json() all moved onto Snapshot,
not Report.

Fix: Added 3 stub methods to the Report class that raise clear,
actionable AttributeError messages showing the correct 0.7+ pattern.

After this fix users see:

AttributeError: `save_html` is not available on the `Report` object 
in Evidently >= 0.7.

In Evidently 0.7+, `report.run()` returns a `Snapshot` object.
Call `save_html` on that snapshot instead:

    snapshot = report.run(current_data, reference_data)
    snapshot.save_html('file.html')

Migration guide: https://docs.evidentlyai.com/faq/migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report object has no attribute save_html function

1 participant