-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Issue #1744] Setup staging tables for Oracle data load #1840
Conversation
created_date: Mapped[datetime.datetime | None] | ||
last_upd_date: Mapped[datetime.datetime | None] |
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.
@jamesbursa This was the only modification I made to the columns, these need to be nullable. Other tables already have these fields nullable, so this just follows the same pattern.
The last update date being null is expected, they only set it to null once it has at least one update. Create date being null seems like a bug, but I found 10 cases in the prod data where it happens
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.
Looks good, minor suggestions.
api/src/db/foreign/forecast.py
Outdated
import datetime | ||
|
||
from sqlalchemy.orm import Mapped, mapped_column | ||
import src.db.legacy_mixins.forecast_mixin as forecast_mixin |
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.
Can shorten to:
import src.db.legacy_mixins.forecast_mixin as forecast_mixin | |
from src.db.legacy_mixins import forecast_mixin |
Summary
Fixes #1744
Time to review: 10 mins
Changes proposed
Setup staging tables for the data ingestion process from Oracle
Modified the foreign tables to instead pull in columns from a mixin (that we reuse for the staging tables)
Context for reviewers
I built this by literally copying the existing foreign tables, and fixing the class name/definitions. The column order should be unmodified, and the columns themselves unmodified (One exception is commented below).
Additional information
I setup a factory for the staging topportunity table (more will be added as needed) just to confirm we can interact with it. Can easily test by running
make console
and then running commands likef.StagingTopportunityFactory(opportunity_id=100, already_transformed=True)