Skip to content

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Feat!: Dev-only VDE mode #5087

wants to merge 25 commits into from

Conversation

izeigerman
Copy link
Member

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:

virtual_environment_mode: 'dev_only'

Switching the mode for an existing project will result in a complete rebuild of all models in the project.

@izeigerman izeigerman requested a review from a team July 31, 2025 23:47
@izeigerman izeigerman force-pushed the feat-non-virtual-prod branch from 2a32f29 to afcef50 Compare July 31, 2025 23:52
@izeigerman izeigerman marked this pull request as draft August 1, 2025 22:51
@izeigerman izeigerman force-pushed the feat-non-virtual-prod branch 3 times, most recently from b268cea to c6844d6 Compare August 11, 2025 15:51
@izeigerman izeigerman force-pushed the feat-non-virtual-prod branch from 5e06d2e to 2ac5969 Compare August 11, 2025 18:53
@izeigerman izeigerman marked this pull request as ready for review August 11, 2025 19:06
DEV_ONLY: Bypass virtual environments in production, using original unversioned model names.
"""

FULL = "full"
Copy link
Contributor

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.

Comment on lines +265 to +268
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`."
)
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Member Author

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
Copy link
Collaborator

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

Copy link
Contributor

@sungchun12 sungchun12 left a comment

Choose a reason for hiding this comment

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

Quick docs suggestions.

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.

4 participants