-
Notifications
You must be signed in to change notification settings - Fork 240
Feat!: Dev-only VDE mode #5087
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
base: main
Are you sure you want to change the base?
Feat!: Dev-only VDE mode #5087
Conversation
2a32f29
to
afcef50
Compare
b268cea
to
c6844d6
Compare
5e06d2e
to
2ac5969
Compare
DEV_ONLY: Bypass virtual environments in production, using original unversioned model names. | ||
""" | ||
|
||
FULL = "full" |
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.
Minor: Is the term "FULL" being used because of "FULL" in auto-categorization? "ALL" feels better to me but I'm wondering if there is some intention behind using "FULL" that I am missing.
if self.plan.use_finalized_state and not self.virtual_environment_mode.is_full: | ||
raise ConfigError( | ||
"Using the finalized state is only supported when `virtual_environment_mode` is set to `full`." | ||
) |
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.
Is this because a "partial" state doesn't make sense if you aren't using VDE in prod? If so, what would be the negative in allowing this? Just doesn't have much meaning?
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.
Actually, since dev-only VDE always assumes a forward-only plan, this check is no longer relevant. Will remove it, thanks
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.
I thought about this more and concluded that indeed this configuration is meaningless when used with dev-only VDEs since there are no previous table versions to go back to.
@@ -499,6 +509,10 @@ class SnapshotTableInfo(PydanticModel, SnapshotInfoMixin, frozen=True): | |||
dev_table_suffix: str | |||
model_gateway: t.Optional[str] = None | |||
forward_only: bool = False | |||
table_naming_convention: TableNamingConvention = TableNamingConvention.default |
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.
Interesting, I struggled to get this to work. mypy wouldnt let me have it both here and on SnapshotInfoMixin
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.
Quick docs suggestions.
This PR adds support for the
dev_only
Virtual Data Environment (VDE) mode.In this mode VDE is applied only in development environments, while in production, model tables and views are updated directly, bypassing the virtual layer. This also means that physical tables in production will be created using the original, unversioned model names. Users will continue to benefit from VDE and data reuse across development environments.
The new mode can be enabled in the project configuration:
Switching the mode for an existing project will result in a complete rebuild of all models in the project.