Skip to content

Chore: Use 'dev' suffix instead of 'temp' for non-deployable physical tables#3803

Merged
izeigerman merged 2 commits intomainfrom
chore-refactor-dev-version-and-table-name
Feb 11, 2025
Merged

Chore: Use 'dev' suffix instead of 'temp' for non-deployable physical tables#3803
izeigerman merged 2 commits intomainfrom
chore-refactor-dev-version-and-table-name

Conversation

@izeigerman
Copy link
Contributor

This PR ensures consistent terminology in the codebase for referring to non-deployable physical tables. The non-deployable physical tables are going to be called as "dev" tables going forward.

Additionally, this updates changes the suffix for non-deployable table names from __temp to __dev for the following reasons:

  • These tables are not truly temporary; their lifespan matches that of the snapshots they are associated with. As long as a snapshot exists, its corresponding dev table persists
  • The existing suffix confuses users who don't like seeing something that looks like a temporary table in their warehouse
  • __temp is used elsewhere in the codebase to denote actual temporary tables, whose lifespan does not extend beyond the duration of the user session

At the same time, this update ensures that existing dev tables with the old suffix are not lost or orphaned. Existing snapshots will continue to follow the old naming pattern. All new snapshots will follow the new naming pattern.

@izeigerman izeigerman requested a review from a team February 7, 2025 21:58
@izeigerman izeigerman force-pushed the chore-refactor-dev-version-and-table-name branch from 2df7aae to 8752696 Compare February 7, 2025 22:06
}

new_snapshots = []
for (
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to come up with safer ways to write migrations, I see a lot of duplication / potential for issues between the migration scripts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Duplication is by design, since we can't reuse anything in the current code base, nor can we reuse anything from previous migrations. Each script must be self-contained and isolated.

@izeigerman izeigerman merged commit fa5312b into main Feb 11, 2025
21 checks passed
@izeigerman izeigerman deleted the chore-refactor-dev-version-and-table-name branch February 11, 2025 01:58
justinjoseph89 added a commit to trygforsikring/sqlmesh that referenced this pull request Feb 20, 2025
* Chore: replace mysql-connector-python with pymysql (SQLMesh#3788)

* feat: don't force db connect if using serverless (SQLMesh#3786)

* Feat: Add 'auditing' and 'promoting' runtime stages (SQLMesh#3791)

* fix: databricks set default catalog for both connections (SQLMesh#3793)

* Docs: Prod Env Observability updates (SQLMesh#3790)

Co-authored-by: Trey Spiller <1831878+treysp@users.noreply.github.com>
Co-authored-by: Trey Spiller <treyspiller@gmail.com>

* Docs: update jinja gateway variable syntax (SQLMesh#3795)

* Fix: Only promote all snapshots if the target environment expired (SQLMesh#3797)

* Chore: remove [missing dates] from CLI model backfills title (SQLMesh#3796)

* Fix: Make sure that physical tables exist for promoted snapshots (SQLMesh#3798)

* fix: db properly support `with_log_level` (SQLMesh#3799)

* fix: run integration tests in session (SQLMesh#3801)

* Fix: specify init duckdb database so quickstart works (SQLMesh#3800)

* Docs: clarify in faq that run ignores local definitions  (SQLMesh#3794)

* feat: add airflow operator and hook for ClickHouse (SQLMesh#3699)

* Feat: Allow macros in python model properties (SQLMesh#3740)

* Docs: update CLI quickstart's CLI output (SQLMesh#3802)

* Fix: Ensure diff sample displays when table names have been uppercased (SQLMesh#3806)

* Fix: update github links for pdoc api docs (SQLMesh#3807)

* Feat: Run audits as non-blocking on dev previews (SQLMesh#3809)

* Chore!: bump sqlglot to v26.6.0 (SQLMesh#3810)

* Feat!: Adjust physical_properties evaluation and add macro to resolve physical table names (SQLMesh#3772)

* Chore: Use 'dev' suffix instead of 'temp' for non-deployable physical tables (SQLMesh#3803)

* Fix!: Propagate the grain attribute when converting dbt models (SQLMesh#3804)

* Docs(dagster): Fix installation instructions (SQLMesh#3812)

* fix: add kwargs to build_table_properties_exp (SQLMesh#3817)

* Feat: include alter statements in destructive change error message (SQLMesh#3805)

* Dagster demo and tutorial video (SQLMesh#3822)

* fix: databricks with_log_level (SQLMesh#3823)

* Feat: improve audit error message formatting (SQLMesh#3818)

* Fix(postgres): Quote role names if required when running SET ROLE on cursor init (SQLMesh#3825)

* Fix: handle quoted projects properly in bigquery adapter (SQLMesh#3820)

* Chore: Fix flaky test (SQLMesh#3828)

* docs: adding self hosted executor docs (SQLMesh#3816)

* Revert "Fix(postgres): Quote role names if required when running SET ROLE on cursor init" (SQLMesh#3834)

* Fix: Don't fail because of an unrestorable change if the target model is forward-only (SQLMesh#3835)

* Chore: improve metadata update console printing (SQLMesh#3824)

* fix: respect disable_restatement remove intervals across env (SQLMesh#3838)

* fix: respect disable restate dev unpaused snapshots (SQLMesh#3840)

* Feat: add [WARNING] to console warning messages (SQLMesh#3826)

* Feat: Extend support of project wide model properties (SQLMesh#3832)

* Fix: Streamline execution of pre- / post- statements when creating a physical table (SQLMesh#3837)

* fix: signals that return an empty list are considered ready (SQLMesh#3841)

* Chore: Add the ingress section to the self-hosted executor docs

* Fix: Snapshots promoted in prod shouldn't be restated in dev (SQLMesh#3843)

* Fix: Inference of python model names from the file system (SQLMesh#3844)

* feat: add support for datetime/date in macros (SQLMesh#3846)

* fix: only expand restatement range if incremental (SQLMesh#3847)

* feat: improve gcp postgres connection config options (SQLMesh#3842)

* Fix: Pin PyGithub to 2.5.0 so tests can run (SQLMesh#3851)

* Fix: Warn when SQLMesh automatically adjusts a restatement range to cover the whole model (SQLMesh#3850)

* fix!: normalize catalog override name (SQLMesh#3849)

* Feat: allow different warning messages for logger and console (SQLMesh#3836)

* Chore: fix audit doc typos (SQLMesh#3856)

* Add airflow tutorial video (SQLMesh#3860)

* Feat!: add model blueprinting (SQLMesh#3848)

* Fix: Make sure that pending restatement intervals are always recorded last during compaction (SQLMesh#3862)

* Chore: Break up the plan_builder method in Context (SQLMesh#3867)

* fix: give better error message when object not serializable (SQLMesh#3861)

* Feat: make date_spine macro less strict to allow dynamic behavior (SQLMesh#3865)

* Add Tcloud SSO docs (SQLMesh#3827)

* Fix: Unexpected backfill of a parent of a changed forward-only child when the child runs before the parent (SQLMesh#3871)

* Feat: Allow CustomKind subclasses for custom materializations (SQLMesh#3863)

* Chore: consolidate `make install-*` (SQLMesh#3874)

---------

Co-authored-by: Trey Spiller <1831878+treysp@users.noreply.github.com>
Co-authored-by: Ryan Eakman <6326532+eakmanrq@users.noreply.github.com>
Co-authored-by: Iaroslav Zeigerman <zeigerman.ia@gmail.com>
Co-authored-by: Marisa Smith <66020208+mesmith027@users.noreply.github.com>
Co-authored-by: Trey Spiller <treyspiller@gmail.com>
Co-authored-by: Anton Parfenyuk <spar9a@gmail.com>
Co-authored-by: Themis Valtinos <73662635+themisvaltinos@users.noreply.github.com>
Co-authored-by: Gerasimos Kounadis <gerasimoskounadis@gmail.com>
Co-authored-by: Erin Drummond <erin.dru@gmail.com>
Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
Co-authored-by: Sung Won Chung <sungwonchung3@gmail.com>
Co-authored-by: Ben <9087625+benfdking@users.noreply.github.com>
Co-authored-by: Philippe Laflamme <484152+plaflamme@users.noreply.github.com>
Co-authored-by: Toby Mao <toby.mao@gmail.com>
Co-authored-by: Afzal Jasani <amj355@nyu.edu>
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