Skip to content
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

DEV_21 #6

Merged
merged 33 commits into from
Feb 23, 2024
Merged

DEV_21 #6

merged 33 commits into from
Feb 23, 2024

Conversation

daroczig
Copy link
Member

@daroczig daroczig commented Feb 20, 2024

  • auto-merge new instances to the database
  • ^^ required quite some refactoring and moving around stuff
  • restructured aws.py into helper/getter sections (sorry, this is a painful diff)
  • introduced a new CLI option to update only some of the tables

@daroczig daroczig marked this pull request as ready for review February 21, 2024 23:14
@@ -49,8 +50,15 @@ def __init__(subclass, *args, **kwargs):
comment = satable.columns[k].comment
if v.description and comment is None:
satable.columns[k].comment = v.description
# append inserted_at as last column
satable.append_column(Column("inserted_at", DateTime, default=datetime.utcnow))
# append observed_at as last column
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will/are we get/ting the actual version of the DB before running this, or will this column always contain new values on every run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the observed_at column is inserted at the SQLAlchemy level, SQLModel doesn't know about it (it's not a ~pydantic field), so if there's no change in the actual values of the row, the observed_at field will NOT be updated in the database via the session.merge calls.

@daroczig daroczig merged commit 31c5791 into main Feb 23, 2024
1 check passed
@daroczig daroczig deleted the DEV-21 branch February 23, 2024 10:09
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.

2 participants