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.
This pull request refactors database engine handling, improves configuration loading, and enhances table import logic for better maintainability and flexibility. The main changes include replacing the
toep_enginewith a more generalegon_engine, refactoring config loading to handle time parsing robustly, and making table/schema mapping lazy-loaded and context-aware. Additionally, the table import logic is now more flexible for both remote and local databases.Database engine and import logic refactor:
toep_enginewithegon_enginethroughoutedisgo.pyto standardize database engine handling. [1] [2] [3] [4] [5]import_tables_from_oepinconfig.pyto support both remote (OEP/toep) and local (egon_data) database engines, including dynamic ORM class creation for local databases.Configuration and mapping improvements:
_ensure_db_mappings_loaded, improving performance and reliability for remote OEP access. [1] [2] [3]"model_draft"to"dataset"and improved error handling when importing modules and attributes for mappings. [1] [2]Configuration file parsing enhancements:
demandlibconfiguration entries using_normalize_demandlib_times, replacing scattered manual parsing in bothfrom_cfgandfrom_json. [1] [2] [3]Miscellaneous improvements:
getfunction for config value retrieval by iterating over possible type accessors, reducing nested try/except blocks.pytest.engine_localwhen the--runlocaloption is used.# Description