Skip to content

Commit b10a32a

Browse files
committed
migrate_ddl -> migrate_schemas, migrate_dml -> migrate_rows
1 parent e6cad2b commit b10a32a

File tree

96 files changed

+192
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+192
-192
lines changed

sqlmesh/core/state_sync/db/migrator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ def _apply_migrations(
177177

178178
for migration in migrations:
179179
logger.info(f"Applying migration {migration}")
180-
migration.migrate_ddl(state_sync, default_catalog=default_catalog)
180+
migration.migrate_schemas(state_sync, default_catalog=default_catalog)
181181
if state_table_exist:
182182
# No need to run DML for the initial migration since all tables are empty
183-
migration.migrate_dml(state_sync, default_catalog=default_catalog)
183+
migration.migrate_rows(state_sync, default_catalog=default_catalog)
184184

185185
snapshot_count_after = self.snapshot_state.count()
186186

sqlmesh/migrations/v0001_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from sqlmesh.utils.migration import index_text_type
1010

1111

12-
def migrate_ddl(state_sync, **kwargs): # type: ignore
12+
def migrate_schemas(state_sync, **kwargs): # type: ignore
1313
engine_adapter = state_sync.engine_adapter
1414
schema = state_sync.schema
1515
snapshots_table = "_snapshots"
@@ -60,5 +60,5 @@ def migrate_ddl(state_sync, **kwargs): # type: ignore
6060
)
6161

6262

63-
def migrate_dml(state_sync, **kwargs): # type: ignore
63+
def migrate_rows(state_sync, **kwargs): # type: ignore
6464
pass
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Remove identify=True kwarg for rendering sql"""
22

33

4-
def migrate_ddl(state_sync, **kwargs): # type: ignore
4+
def migrate_schemas(state_sync, **kwargs): # type: ignore
55
pass
66

77

8-
def migrate_dml(state_sync, **kwargs): # type: ignore
8+
def migrate_rows(state_sync, **kwargs): # type: ignore
99
pass

sqlmesh/migrations/v0003_move_batch_size.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from sqlglot import exp
66

77

8-
def migrate_ddl(state_sync, **kwargs): # type: ignore
8+
def migrate_schemas(state_sync, **kwargs): # type: ignore
99
pass
1010

1111

12-
def migrate_dml(state_sync, **kwargs): # type: ignore
12+
def migrate_rows(state_sync, **kwargs): # type: ignore
1313
snapshots_table = "_snapshots"
1414
if state_sync.schema:
1515
snapshots_table = f"{state_sync.schema}.{snapshots_table}"

sqlmesh/migrations/v0004_environmnent_add_finalized_at.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from sqlglot import exp
44

55

6-
def migrate_ddl(state_sync, **kwargs): # type: ignore
6+
def migrate_schemas(state_sync, **kwargs): # type: ignore
77
engine_adapter = state_sync.engine_adapter
88
environments_table = "_environments"
99
if state_sync.schema:
@@ -23,5 +23,5 @@ def migrate_ddl(state_sync, **kwargs): # type: ignore
2323
engine_adapter.execute(alter_table_exp)
2424

2525

26-
def migrate_dml(state_sync, **kwargs): # type: ignore
26+
def migrate_rows(state_sync, **kwargs): # type: ignore
2727
pass

sqlmesh/migrations/v0005_create_seed_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from sqlmesh.utils.migration import index_text_type
66

77

8-
def migrate_ddl(state_sync, **kwargs): # type: ignore
8+
def migrate_schemas(state_sync, **kwargs): # type: ignore
99
engine_adapter = state_sync.engine_adapter
1010
seeds_table = "_seeds"
1111
if state_sync.schema:
@@ -24,5 +24,5 @@ def migrate_ddl(state_sync, **kwargs): # type: ignore
2424
)
2525

2626

27-
def migrate_dml(state_sync, **kwargs): # type: ignore
27+
def migrate_rows(state_sync, **kwargs): # type: ignore
2828
pass
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Seed hashes moved from to_string to to_json for performance."""
22

33

4-
def migrate_ddl(state_sync, **kwargs): # type: ignore
4+
def migrate_schemas(state_sync, **kwargs): # type: ignore
55
pass
66

77

8-
def migrate_dml(state_sync, **kwargs): # type: ignore
8+
def migrate_rows(state_sync, **kwargs): # type: ignore
99
pass

sqlmesh/migrations/v0007_env_table_info_to_kind.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def _hash(data): # type: ignore
1212
return str(zlib.crc32(";".join("" if d is None else d for d in data).encode("utf-8")))
1313

1414

15-
def migrate_ddl(state_sync, **kwargs): # type: ignore
15+
def migrate_schemas(state_sync, **kwargs): # type: ignore
1616
pass
1717

1818

19-
def migrate_dml(state_sync, **kwargs): # type: ignore
19+
def migrate_rows(state_sync, **kwargs): # type: ignore
2020
import pandas as pd
2121

2222
engine_adapter = state_sync.engine_adapter

sqlmesh/migrations/v0008_create_intervals_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from sqlmesh.utils.migration import index_text_type
66

77

8-
def migrate_ddl(state_sync, **kwargs): # type: ignore
8+
def migrate_schemas(state_sync, **kwargs): # type: ignore
99
engine_adapter = state_sync.engine_adapter
1010
intervals_table = "_intervals"
1111
if state_sync.schema:
@@ -38,5 +38,5 @@ def migrate_ddl(state_sync, **kwargs): # type: ignore
3838
)
3939

4040

41-
def migrate_dml(state_sync, **kwargs): # type: ignore
41+
def migrate_rows(state_sync, **kwargs): # type: ignore
4242
pass

sqlmesh/migrations/v0009_remove_pre_post_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
from sqlmesh.utils.migration import index_text_type
88

99

10-
def migrate_ddl(state_sync, **kwargs): # type: ignore
10+
def migrate_schemas(state_sync, **kwargs): # type: ignore
1111
pass
1212

1313

14-
def migrate_dml(state_sync, **kwargs): # type: ignore
14+
def migrate_rows(state_sync, **kwargs): # type: ignore
1515
import pandas as pd
1616

1717
engine_adapter = state_sync.engine_adapter

0 commit comments

Comments
 (0)