sqlmesh 0.184.4.dev11__py3-none-any.whl → 0.184.4.dev13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlmesh/_version.py +2 -2
- sqlmesh/dbt/adapter.py +11 -13
- sqlmesh/integrations/github/cicd/command.py +3 -3
- sqlmesh/integrations/github/cicd/config.py +7 -0
- sqlmesh/integrations/github/cicd/controller.py +5 -1
- {sqlmesh-0.184.4.dev11.dist-info → sqlmesh-0.184.4.dev13.dist-info}/METADATA +1 -1
- {sqlmesh-0.184.4.dev11.dist-info → sqlmesh-0.184.4.dev13.dist-info}/RECORD +11 -11
- {sqlmesh-0.184.4.dev11.dist-info → sqlmesh-0.184.4.dev13.dist-info}/WHEEL +0 -0
- {sqlmesh-0.184.4.dev11.dist-info → sqlmesh-0.184.4.dev13.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.184.4.dev11.dist-info → sqlmesh-0.184.4.dev13.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.184.4.dev11.dist-info → sqlmesh-0.184.4.dev13.dist-info}/top_level.txt +0 -0
sqlmesh/_version.py
CHANGED
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.184.4.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 184, 4, '
|
|
20
|
+
__version__ = version = '0.184.4.dev13'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 184, 4, 'dev13')
|
sqlmesh/dbt/adapter.py
CHANGED
|
@@ -7,7 +7,7 @@ import typing as t
|
|
|
7
7
|
import pandas as pd
|
|
8
8
|
from sqlglot import exp, parse_one
|
|
9
9
|
|
|
10
|
-
from sqlmesh.core.dialect import normalize_and_quote, normalize_model_name
|
|
10
|
+
from sqlmesh.core.dialect import normalize_and_quote, normalize_model_name, schema_
|
|
11
11
|
from sqlmesh.core.engine_adapter import EngineAdapter
|
|
12
12
|
from sqlmesh.core.snapshot import DeployabilityIndex, Snapshot, to_table_mapping
|
|
13
13
|
from sqlmesh.utils.errors import ConfigError, ParsetimeAdapterCallError
|
|
@@ -245,14 +245,11 @@ class RuntimeAdapter(BaseAdapter):
|
|
|
245
245
|
def get_relation(
|
|
246
246
|
self, database: t.Optional[str], schema: str, identifier: str
|
|
247
247
|
) -> t.Optional[BaseRelation]:
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
quote_policy=self.quote_policy,
|
|
254
|
-
)
|
|
255
|
-
)
|
|
248
|
+
target_table = exp.table_(identifier, db=schema, catalog=database)
|
|
249
|
+
# Normalize before converting to a relation; otherwise, it will be too late,
|
|
250
|
+
# as quotes will have already been applied.
|
|
251
|
+
target_table = self._normalize(target_table)
|
|
252
|
+
return self.load_relation(self._table_to_relation(target_table))
|
|
256
253
|
|
|
257
254
|
def load_relation(self, relation: BaseRelation) -> t.Optional[BaseRelation]:
|
|
258
255
|
mapped_table = self._map_table_name(self._normalize(self._relation_to_table(relation)))
|
|
@@ -262,10 +259,11 @@ class RuntimeAdapter(BaseAdapter):
|
|
|
262
259
|
return self._table_to_relation(mapped_table)
|
|
263
260
|
|
|
264
261
|
def list_relations(self, database: t.Optional[str], schema: str) -> t.List[BaseRelation]:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
262
|
+
target_schema = schema_(schema, catalog=database)
|
|
263
|
+
# Normalize before converting to a relation; otherwise, it will be too late,
|
|
264
|
+
# as quotes will have already been applied.
|
|
265
|
+
target_schema = self._normalize(target_schema)
|
|
266
|
+
return self.list_relations_without_caching(self._table_to_relation(target_schema))
|
|
269
267
|
|
|
270
268
|
def list_relations_without_caching(self, schema_relation: BaseRelation) -> t.List[BaseRelation]:
|
|
271
269
|
from sqlmesh.dbt.relation import RelationType
|
|
@@ -210,7 +210,7 @@ def _run_all(controller: GithubController) -> None:
|
|
|
210
210
|
has_required_approval = False
|
|
211
211
|
is_auto_deploying_prod = (
|
|
212
212
|
controller.deploy_command_enabled or controller.do_required_approval_check
|
|
213
|
-
)
|
|
213
|
+
) and controller.pr_targets_prod_branch
|
|
214
214
|
if controller.is_comment_added:
|
|
215
215
|
if not controller.deploy_command_enabled:
|
|
216
216
|
# We aren't using commands so we can just return
|
|
@@ -267,7 +267,7 @@ def _run_all(controller: GithubController) -> None:
|
|
|
267
267
|
status=GithubCheckStatus.COMPLETED, conclusion=GithubCheckConclusion.SKIPPED
|
|
268
268
|
)
|
|
269
269
|
deployed_to_prod = False
|
|
270
|
-
if has_required_approval and prod_plan_generated:
|
|
270
|
+
if has_required_approval and prod_plan_generated and controller.pr_targets_prod_branch:
|
|
271
271
|
deployed_to_prod = _deploy_production(controller)
|
|
272
272
|
elif is_auto_deploying_prod:
|
|
273
273
|
if not has_required_approval:
|
|
@@ -292,7 +292,7 @@ def _run_all(controller: GithubController) -> None:
|
|
|
292
292
|
if (
|
|
293
293
|
not pr_environment_updated
|
|
294
294
|
or not prod_plan_generated
|
|
295
|
-
or (has_required_approval and not deployed_to_prod)
|
|
295
|
+
or (has_required_approval and controller.pr_targets_prod_branch and not deployed_to_prod)
|
|
296
296
|
):
|
|
297
297
|
raise CICDBotError(
|
|
298
298
|
"A step of the run-all check failed. See check status for more information."
|
|
@@ -28,6 +28,7 @@ class GithubCICDBotConfig(BaseConfig):
|
|
|
28
28
|
pr_include_unmodified: t.Optional[bool] = None
|
|
29
29
|
run_on_deploy_to_prod: bool = False
|
|
30
30
|
pr_environment_name: t.Optional[str] = None
|
|
31
|
+
prod_branch_names_: t.Optional[str] = Field(default=None, alias="prod_branch_name")
|
|
31
32
|
|
|
32
33
|
@model_validator(mode="before")
|
|
33
34
|
@classmethod
|
|
@@ -42,6 +43,12 @@ class GithubCICDBotConfig(BaseConfig):
|
|
|
42
43
|
|
|
43
44
|
return data
|
|
44
45
|
|
|
46
|
+
@property
|
|
47
|
+
def prod_branch_names(self) -> t.List[str]:
|
|
48
|
+
if self.prod_branch_names_:
|
|
49
|
+
return [self.prod_branch_names_]
|
|
50
|
+
return ["main", "master"]
|
|
51
|
+
|
|
45
52
|
FIELDS_FOR_ANALYTICS: t.ClassVar[t.Set[str]] = {
|
|
46
53
|
"invalidate_environment_after_deploy",
|
|
47
54
|
"enable_deploy_command",
|
|
@@ -76,7 +76,7 @@ class PullRequestInfo(PydanticModel):
|
|
|
76
76
|
return cls(
|
|
77
77
|
owner=owner,
|
|
78
78
|
repo=repo,
|
|
79
|
-
pr_number=pr_number,
|
|
79
|
+
pr_number=int(pr_number),
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
|
|
@@ -444,6 +444,10 @@ class GithubController:
|
|
|
444
444
|
def removed_snapshots(self) -> t.Set[SnapshotId]:
|
|
445
445
|
return set(self.prod_plan_with_gaps.context_diff.removed_snapshots)
|
|
446
446
|
|
|
447
|
+
@property
|
|
448
|
+
def pr_targets_prod_branch(self) -> bool:
|
|
449
|
+
return self._pull_request.base.ref in self.bot_config.prod_branch_names
|
|
450
|
+
|
|
447
451
|
@classmethod
|
|
448
452
|
def _append_output(cls, key: str, value: str) -> None:
|
|
449
453
|
"""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=DRovDXI-9D9xeYDP7t8Fq7mI31S2btlN-LHPOK3y7PA,7240
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=soLKGPyCgtFqUZ6yuvVyDncWwGV9eTo79i-HsiN5N9Q,530
|
|
3
3
|
sqlmesh/magics.py,sha256=aeOyTdeNnyGzGtJXECDAbqJ8OAplrV4UAYl0I2hhtig,39670
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -121,7 +121,7 @@ sqlmesh/core/test/discovery.py,sha256=WXIwPidLoacAGHoT_3TVFFEKamG89nHNtaMsZ01uGj
|
|
|
121
121
|
sqlmesh/core/test/result.py,sha256=CR8c_tdBK7p8jx-dMibbj4zCtxVAmE_Xah9GQ5oPBTE,4218
|
|
122
122
|
sqlmesh/core/test/runner.py,sha256=yno0GDUW9angCy2ZeLIZE9lKrqBiJOnFibu6RLuct6I,6647
|
|
123
123
|
sqlmesh/dbt/__init__.py,sha256=KUv-lW5sG9D2ceXAIzA4MLcjyhzq3E-7qJP4P_PH2EU,144
|
|
124
|
-
sqlmesh/dbt/adapter.py,sha256=
|
|
124
|
+
sqlmesh/dbt/adapter.py,sha256=NAY8E7R9S-DsKn3LnPUvZvQNONRE7hthmuBs1a5ao64,16761
|
|
125
125
|
sqlmesh/dbt/basemodel.py,sha256=XuiK9-r5JWzvZGEk98Jt4ukR2exfMDsotGZqYx5xluc,12561
|
|
126
126
|
sqlmesh/dbt/builtin.py,sha256=fyzv4qR1isfnID1oWz-r46oDQvS90DN5mMUEWgapvN8,15153
|
|
127
127
|
sqlmesh/dbt/column.py,sha256=Kvj_N3D_QegcoNQG7VqRiqy-FRfupud-6ilhlykBOgE,1873
|
|
@@ -152,9 +152,9 @@ sqlmesh/integrations/llm.py,sha256=URgp3JKr06HYv6hGlJ7DQ9m3QCc41xRWK23HzmGpbDI,1
|
|
|
152
152
|
sqlmesh/integrations/slack.py,sha256=nxLxu5WztGbZH3JdqnzyPqmJUMfRdJ_49LQ7zR-u39Q,6801
|
|
153
153
|
sqlmesh/integrations/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
154
154
|
sqlmesh/integrations/github/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
155
|
-
sqlmesh/integrations/github/cicd/command.py,sha256=
|
|
156
|
-
sqlmesh/integrations/github/cicd/config.py,sha256=
|
|
157
|
-
sqlmesh/integrations/github/cicd/controller.py,sha256=
|
|
155
|
+
sqlmesh/integrations/github/cicd/command.py,sha256=E3G53jlLEgu1nCHpGW-P7zklIyp6wGWtkJQ-6xJHclI,11415
|
|
156
|
+
sqlmesh/integrations/github/cicd/config.py,sha256=tRhMZaLf1p6AWXvi67n85Q-lptJNGt1Wk_Jr61ytpiM,2104
|
|
157
|
+
sqlmesh/integrations/github/cicd/controller.py,sha256=EXFB_AHR_B4gTXMjX3CE6jZSvlENJ2BiI-Y7Wg6eGq4,41667
|
|
158
158
|
sqlmesh/lsp/api.py,sha256=LJdECSaEZoPbu_Xl4KscVG-WLt7_g4dY-zKGO68dH14,2162
|
|
159
159
|
sqlmesh/lsp/completions.py,sha256=Uo8lUzPBeoB58Eu2642YoAtNI0pgIFWFSvwmuJALTv4,3583
|
|
160
160
|
sqlmesh/lsp/context.py,sha256=Ff09vrsawdYS-7YcXbGZW_RU-tj_-k8WV7maCghpYp0,1438
|
|
@@ -268,7 +268,7 @@ sqlmesh/utils/pydantic.py,sha256=-u69PDY-4FLR7ODNKBoN7PsPNmZ0wdhsJcCAG2P6vyY,110
|
|
|
268
268
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
269
269
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
270
270
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
271
|
-
sqlmesh-0.184.4.
|
|
271
|
+
sqlmesh-0.184.4.dev13.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
272
272
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
273
273
|
web/client/dist/index.html,sha256=x9qfdHkVkXOwWRFRCZGaixiLj5e9tOQsCDRR92vW9QI,5472
|
|
274
274
|
web/client/dist/assets/Audits-cGDtiiKB.js,sha256=jrS4x1nQ8Klx67744_LjNI2oBOI9XnnygDR-0wmlme8,1041
|
|
@@ -386,8 +386,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
386
386
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
387
387
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
388
388
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
389
|
-
sqlmesh-0.184.4.
|
|
390
|
-
sqlmesh-0.184.4.
|
|
391
|
-
sqlmesh-0.184.4.
|
|
392
|
-
sqlmesh-0.184.4.
|
|
393
|
-
sqlmesh-0.184.4.
|
|
389
|
+
sqlmesh-0.184.4.dev13.dist-info/METADATA,sha256=1ELUZPyOjoBtEADQLARzn0mBS6yJHZR7b-M5KF7lwl4,25499
|
|
390
|
+
sqlmesh-0.184.4.dev13.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
391
|
+
sqlmesh-0.184.4.dev13.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
392
|
+
sqlmesh-0.184.4.dev13.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
393
|
+
sqlmesh-0.184.4.dev13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|