You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lightautoml/report/__init__.py file includes a call to __validate_extra_deps("pdf") at import time. This causes any import of lightautoml.automl.presets.tabular_presets to fail if the optional pdf dependencies are not installed, even if the user only needs TabularAutoML/TabularUtilizedAutoML and has no intention of generating PDF reports.
Fix
Removed the immediate validation call from lightautoml/report/__init__.py. The optional dependencies will still be checked when actually using report functionality, if those modules perform the validation themselves (or this is now the responsibility of report users). This allows core imports to succeed without requiring the pdf extra.
@botbikamordehai2-sketch thanks for the PR! I reviewed #147 and don’t think this change addresses the reported failure.
The traceback in #147 never reaches lightautoml.report, and weasyprint was already installed in the affected environment. The failure occurs while importing lightgbm, through dask/pandas/numexpr, and is consistent with an incompatible dependency set from an old LightAutoML release.
Also, __validate_extra_deps("pdf") is not strict in its current form: it is called with the default error=False, so a missing PDF dependency only produces a warning and does not prevent the import. Removing the call therefore suppresses that warning, but cannot fix the TabularAutoML import error from #147.
The lazy weasyprint import in ReportDeco.generate_report() already handles a missing PDF dependency when PDF generation is actually requested.
Could you please either:
add a minimal reproduction showing that this validation call causes a current import failure, together with a regression test; or
narrow the scope of the PR to avoiding premature PDF-extra warnings on lightautoml.report import, update the title/body accordingly, and add coverage for HTML reports without the report extra?
Until then, I don’t think this PR should close #147.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
lightautoml/report/__init__.pyfile includes a call to__validate_extra_deps("pdf")at import time. This causes any import oflightautoml.automl.presets.tabular_presetsto fail if the optional pdf dependencies are not installed, even if the user only needs TabularAutoML/TabularUtilizedAutoML and has no intention of generating PDF reports.Fix
Removed the immediate validation call from
lightautoml/report/__init__.py. The optional dependencies will still be checked when actually using report functionality, if those modules perform the validation themselves (or this is now the responsibility of report users). This allows core imports to succeed without requiring thepdfextra.Closes #147