-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add attributes column to data_source
table
#750
feat: add attributes column to data_source
table
#750
Conversation
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see you are writing your own db migration. And thanks for dividing your work in these smaller PRs.
I'm looking forward to seeing how this will tie in with persisting reporter configurations. I have some small comments for now, and the changelog should also get a db upgrade notification for 0.15.
flexmeasures/data/migrations/versions/2ac7fb39ce0c_add_attribute_column_to_data_source.py
Outdated
Show resolved
Hide resolved
flexmeasures/data/migrations/versions/2ac7fb39ce0c_add_attribute_column_to_data_source.py
Show resolved
Hide resolved
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
…-column-data-source' into feature/reporting/add-attributes-column-data-source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a changelog entry for this could note that the DataSource table now allows storing arbitrary attributes as a JSON (without content validation), similar to the Sensor and GenericAsset tables.
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Just still add the db upgrade warning in the changelog (you can copy the warning from earlier versions in the changelog).
Signed-off-by: Victor Garcia Reolid <[email protected]>
…-column-data-source' into feature/reporting/add-attributes-column-data-source
attributes
column to the tabledata_source
to storeDataGenerator
configuration. Type: JSON.attributes_hash
column to the tabledata_source
to store a SHA256 hash of theattributes
column. TypeLargeBinary(length=256)
, in PostgreSQL this is represented as aBYTEA
type.sensors
backref to the DataSource to allow to get the sensors that use aDataSource
(in a Timed Belief).get_attributes
,has_attributes
andset_attribute
.get_or_create_source
to take theattributes
column into account.