Skip to content

fix: remove strict pdf extra dependency check on report import (closes #147) - #179

Open
botbikamordehai2-sketch wants to merge 1 commit into
sb-ai-lab:masterfrom
botbikamordehai2-sketch:fix/issue-147-1786529000
Open

fix: remove strict pdf extra dependency check on report import (closes #147)#179
botbikamordehai2-sketch wants to merge 1 commit into
sb-ai-lab:masterfrom
botbikamordehai2-sketch:fix/issue-147-1786529000

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

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.

Closes #147

@dev-rinchin

Copy link
Copy Markdown
Collaborator

@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:

  1. add a minimal reproduction showing that this validation call causes a current import failure, together with a regression test; or
  2. 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.

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.

from lightautoml.automl.presets.tabular_presets import TabularAutoML, TabularUtilizedAutoML returns error

2 participants