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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Feat!: Dev-only VDE mode #5087

wants to merge 14 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
apply_effective_from = effective_from_ts > 0 and self.identifier != other.identifier
for start, end in other.intervals:
# If the effective_from is set, then intervals that come after it must come from
# the current snapshost.
Copy link
Collaborator

Choose a reason for hiding this comment

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

(historical) nit: snapshost

@@ -1013,15 +1035,18 @@ def categorize_as(self, category: SnapshotChangeCategory) -> None:
category: The change category to assign to this snapshot.
"""
self.dev_version_ = self.fingerprint.to_version()
reuse_previous_version = category in (
is_no_rebuild = category in (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this logic duplicated here and in the self.is_no_rebuild() property?

As a sidenote - thanks for renaming this and _should_force_breaking_change, the new names are much clearer as to the intent compared to the original names

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this logic duplicated here and in the self.is_no_rebuild() property?

yes, but only because _should_force_breaking_change relies on self.change_category which hasn't been set yet at this point.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I was more thinking along the lines of adding a constant something like NON_REBUILDABLE_CHANGE_CATEGORIES={SnapshotChangeCategory.FORWARD_ONLY, ...} and then referencing it in both places rather than maintaining two identical lists

@izeigerman izeigerman marked this pull request as draft August 1, 2025 22:51
@izeigerman izeigerman force-pushed the feat-non-virtual-prod branch from 4971cc6 to caddf38 Compare August 8, 2025 22:30
@izeigerman izeigerman force-pushed the feat-non-virtual-prod branch from caddf38 to b268cea Compare August 8, 2025 22:33
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