516: Dynamically create database tables based on XSD files#684
Closed
Simon-Will wants to merge 7 commits intoOpenEnergyPlatform:622-deprecate-api-downloadfrom
Closed
516: Dynamically create database tables based on XSD files#684Simon-Will wants to merge 7 commits intoOpenEnergyPlatform:622-deprecate-api-downloadfrom
Simon-Will wants to merge 7 commits intoOpenEnergyPlatform:622-deprecate-api-downloadfrom
Conversation
2 tasks
Member
|
@Simon-Will The "deprecate" branch was merged and does not exist anymore, hence this PR should be directed to the "develop" branch. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the discussion
A first attempt at creating tables based on the MaStR XSD files.
Checklist until this is really ready:
mastr_table_to_db_modelreturned fromMastr.generate_data_model. E.g. by adding a function that generates a Python code snippet with the SQLALchemy models/tables.utils_download_bulk.pybecause I found date handling unnecessarily complex. Add interactive download functionality for MaStR date selection #696 #697 changes the same code and adds support for retrieving available XML download dates. If Add interactive download functionality for MaStR date selection #696 #697 is merged, we have to update this retrieval logic to also retrieve the documentation download dates.Type of change (CHANGELOG.md)
Added
Mastr.generate_data_modelthat downloads the newest MaStR documentation and uses the XSD file to build SQLAlchemy models from the contained definitionsUpdated
Mastr.downloadwith two optional new argumentsmastr_table_to_db_table, with which the user can pass their own database schema, andalter_database_tables, with which the user can preventopen-mastrfrom issuing any DDL statements.Removed
Mastr.translatebecause the user can now pass a dict mapping MaStR table names to DB tables. By adjusting their DB table names, they can achieve a similar result.Workflow checklist
Automation
Closes #516
PR-Assignee
Reviewer