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
Follow-up from the review of #4926 (part of the #4913 retirement effort), deferred there as out of scope.
Problem
report_elements.py star-imports the underscore-private _report_utils (which has no __all__), and also does from .entities import *. Without __all__, every module-level name — including imported ones — is re-exported, so private helpers and module aliases become de-facto public API of report_elements. After #4926 this surface includes get_data_df, get_df_over_time, strings_to_lists, and the ga / np / pd / dt module aliases.
Why it matters
Renames inside the nominally private _report_utils can silently break consumers bound via report_elements.*.
The trap in the other direction: static_site/fetch.py:401 uses elements.ADDITIONAL_DATA_BEHAVIOR, which resolves only via star-import re-export (fetch.py's explicit from ..entities import (...) block does not include it). A naive cleanup replacing the star imports with explicit imports breaks static-site generation with AttributeError — and only on runs that pass historic_data_path (i.e. the monthly job), so a smoke test won't catch it.
Suggested fix
Replace the star imports in report_elements.py with explicit imports of the names it actually re-exports (or add __all__ to _report_utils.py and entities.py).
Make fetch.py import ADDITIONAL_DATA_BEHAVIOR explicitly from ..entities.
Follow-up from the review of #4926 (part of the #4913 retirement effort), deferred there as out of scope.
Problem
report_elements.pystar-imports the underscore-private_report_utils(which has no__all__), and also doesfrom .entities import *. Without__all__, every module-level name — including imported ones — is re-exported, so private helpers and module aliases become de-facto public API ofreport_elements. After #4926 this surface includesget_data_df,get_df_over_time,strings_to_lists, and thega/np/pd/dtmodule aliases.Why it matters
_report_utilscan silently break consumers bound viareport_elements.*.static_site/fetch.py:401useselements.ADDITIONAL_DATA_BEHAVIOR, which resolves only via star-import re-export (fetch.py's explicitfrom ..entities import (...)block does not include it). A naive cleanup replacing the star imports with explicit imports breaks static-site generation withAttributeError— and only on runs that passhistoric_data_path(i.e. the monthly job), so a smoke test won't catch it.Suggested fix
report_elements.pywith explicit imports of the names it actually re-exports (or add__all__to_report_utils.pyandentities.py).fetch.pyimportADDITIONAL_DATA_BEHAVIORexplicitly from..entities.generate_static_site.pyrun includinghistoric_data_path, per the chore: retire legacy analytics formats — tracking #4913 verification convention.Context: #4926 (review)