Skip to content

Commit f3add33

Browse files
authored
Merge branch 'main' into chore/update-contributing
2 parents 1182dd4 + c4524e5 commit f3add33

25 files changed

Lines changed: 1064 additions & 478 deletions

File tree

‎.devcontainer/devcontainer.json‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"postCreateCommand": "bash .devcontainer/post-create-command.sh",
1212
"customizations": {
1313
"vscode": {
14-
"extensions": [
15-
"ms-python.python",
16-
"ms-python.vscode-pylance"
17-
]
14+
"extensions": ["ms-python.python", "ms-python.vscode-pylance"]
1815
}
1916
},
2017
"remoteUser": "vscode"

‎.github/workflows/pr.yaml‎

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
outputs:
1717
python: ${{ steps.filter.outputs.python }}
1818
client: ${{ steps.filter.outputs.client }}
19+
vscode: ${{ steps.filter.outputs.vscode }}
1920
ci: ${{ steps.filter.outputs.ci }}
2021
steps:
2122
- uses: actions/checkout@v7
@@ -34,6 +35,8 @@ jobs:
3435
- 'pyproject.toml'
3536
client:
3637
- 'web/client/**'
38+
vscode:
39+
- 'vscode/**'
3740
ci:
3841
- '.github/**'
3942
- 'Makefile'
@@ -188,9 +191,10 @@ jobs:
188191

189192
ui-style:
190193
needs: [changes]
191-
if: false
192-
# needs.changes.outputs.client == 'true' || needs.changes.outputs.ci ==
193-
# 'true' || github.ref == 'refs/heads/main'
194+
if:
195+
needs.changes.outputs.client == 'true' || needs.changes.outputs.vscode ==
196+
'true' || needs.changes.outputs.ci == 'true' || github.ref ==
197+
'refs/heads/main'
194198
runs-on: ubuntu-latest
195199
steps:
196200
- uses: actions/checkout@v7
@@ -252,7 +256,17 @@ jobs:
252256
fail-fast: false
253257
matrix:
254258
engine:
255-
[duckdb, postgres, mysql, mssql, trino, spark, clickhouse, risingwave, starrocks]
259+
[
260+
duckdb,
261+
postgres,
262+
mysql,
263+
mssql,
264+
trino,
265+
spark,
266+
clickhouse,
267+
risingwave,
268+
starrocks,
269+
]
256270
env:
257271
PYTEST_XDIST_AUTO_NUM_WORKERS: 2
258272
SQLMESH__DISABLE_ANONYMIZED_ANALYTICS: '1'
@@ -393,10 +407,13 @@ jobs:
393407
retention-days: 7
394408

395409
test-vscode:
410+
needs: changes
411+
if:
412+
needs.changes.outputs.vscode == 'true' || needs.changes.outputs.ci ==
413+
'true' || github.ref == 'refs/heads/main'
396414
env:
397415
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
398416
runs-on: ubuntu-latest
399-
if: false
400417
steps:
401418
- uses: actions/checkout@v7
402419
- uses: actions/setup-node@v7
@@ -453,11 +470,27 @@ jobs:
453470
path: vscode/extension/playwright-report/
454471
retention-days: 30
455472
test-dbt-versions:
473+
needs: changes
474+
if:
475+
needs.changes.outputs.python == 'true' || needs.changes.outputs.ci ==
476+
'true' || github.ref == 'refs/heads/main'
456477
runs-on: ubuntu-latest
457478
strategy:
458479
fail-fast: false
459480
matrix:
460-
dbt-version: ['1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1.10', '1.11', '1.12']
481+
dbt-version:
482+
[
483+
'1.3',
484+
'1.4',
485+
'1.5',
486+
'1.6',
487+
'1.7',
488+
'1.8',
489+
'1.9',
490+
'1.10',
491+
'1.11',
492+
'1.12',
493+
]
461494
steps:
462495
- uses: actions/checkout@v7
463496
- name: Set up Python

‎.prettierignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ docs
3030
examples
3131
posts
3232
.circleci
33+
.github/
3334
README.md
3435
mkdocs.yml
3536
.readthedocs.yaml

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
},
66
"scripts": {
77
"ci": "pnpm run lint && pnpm run -r ci",
8-
"fmt": "prettier --write .",
9-
"fmt:check": "prettier --check .",
8+
"fmt": "prettier --write vscode web/client web/common",
9+
"fmt:check": "prettier --check vscode web/client web/common",
1010
"lint": "pnpm run fmt:check && pnpm run -r lint",
1111
"lint:fix": "pnpm run fmt && pnpm run -r lint:fix"
1212
},

‎pnpm-lock.yaml‎

Lines changed: 777 additions & 440 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sqlmesh/core/engine_adapter/base.py‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,8 @@ def clone_table(
10941094
replace: bool = False,
10951095
exists: bool = True,
10961096
clone_kwargs: t.Optional[t.Dict[str, t.Any]] = None,
1097+
table_format: t.Optional[str] = None,
1098+
table_kind: t.Optional[str] = None,
10971099
**kwargs: t.Any,
10981100
) -> None:
10991101
"""Creates a table with the target name by cloning the source table.
@@ -1103,6 +1105,10 @@ def clone_table(
11031105
source_table_name: The name of the source table that should be cloned.
11041106
replace: Whether or not to replace an existing table.
11051107
exists: Indicates whether to include the IF NOT EXISTS check.
1108+
clone_kwargs: Additional arguments for the CLONE clause.
1109+
table_format: The table format of the source table, if any. Engines that require
1110+
format-specific DDL to clone a table use it to derive `table_kind`.
1111+
table_kind: The kind of table to create. Defaults to `TABLE`.
11061112
"""
11071113
if not self.SUPPORTS_CLONING:
11081114
raise NotImplementedError(f"Engine does not support cloning: {type(self)}")
@@ -1111,7 +1117,7 @@ def clone_table(
11111117
self.execute(
11121118
exp.Create(
11131119
this=exp.to_table(target_table_name),
1114-
kind="TABLE",
1120+
kind=table_kind or "TABLE",
11151121
replace=replace,
11161122
exists=exists,
11171123
clone=exp.Clone(
@@ -1214,9 +1220,15 @@ def get_alter_operations(
12141220
def alter_table(
12151221
self,
12161222
alter_expressions: t.Union[t.List[exp.Alter], t.List[TableAlterOperation]],
1223+
table_format: t.Optional[str] = None,
12171224
) -> None:
12181225
"""
12191226
Performs the alter statements to change the current table into the structure of the target table.
1227+
1228+
Args:
1229+
alter_expressions: The alter operations to apply.
1230+
table_format: The table format of the target table, if any. Engines that require
1231+
format-specific DDL to alter a table use it to adjust the generated statements.
12201232
"""
12211233
with self.transaction():
12221234
for alter_expression in [

‎sqlmesh/core/engine_adapter/bigquery.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ def create_mapping_schema(
405405
def alter_table(
406406
self,
407407
alter_expressions: t.Union[t.List[exp.Alter], t.List[TableAlterOperation]],
408+
table_format: t.Optional[str] = None,
408409
) -> None:
409410
"""
410411
Performs the alter statements to change the current table into the structure of the target table,

‎sqlmesh/core/engine_adapter/clickhouse.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ def delete_from(self, table_name: TableName, where: t.Union[str, exp.Expr]) -> N
699699
def alter_table(
700700
self,
701701
alter_expressions: t.Union[t.List[exp.Alter], t.List[TableAlterOperation]],
702+
table_format: t.Optional[str] = None,
702703
) -> None:
703704
"""
704705
Performs the alter statements to change the current table into the structure of the target table.

‎sqlmesh/core/engine_adapter/databricks.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ def clone_table(
386386
replace: bool = False,
387387
exists: bool = True,
388388
clone_kwargs: t.Optional[t.Dict[str, t.Any]] = None,
389+
table_format: t.Optional[str] = None,
390+
table_kind: t.Optional[str] = None,
389391
**kwargs: t.Any,
390392
) -> None:
391393
clone_kwargs = clone_kwargs or {}
@@ -395,6 +397,8 @@ def clone_table(
395397
source_table_name,
396398
replace=replace,
397399
clone_kwargs=clone_kwargs,
400+
table_format=table_format,
401+
table_kind=table_kind,
398402
**kwargs,
399403
)
400404

‎sqlmesh/core/engine_adapter/fabric.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ def set_current_catalog(self, catalog_name: t.Optional[str]) -> None:
225225
self._target_catalog = target_catalog
226226

227227
def alter_table(
228-
self, alter_expressions: t.Union[t.List[exp.Alter], t.List[TableAlterOperation]]
228+
self,
229+
alter_expressions: t.Union[t.List[exp.Alter], t.List[TableAlterOperation]],
230+
table_format: t.Optional[str] = None,
229231
) -> None:
230232
"""
231233
Applies alter expressions to a table. Fabric has limited support for ALTER TABLE,

0 commit comments

Comments
 (0)