sqlmesh 0.184.3.dev7__py3-none-any.whl → 0.184.3.dev8__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 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.3.dev7'
21
- __version_tuple__ = version_tuple = (0, 184, 3, 'dev7')
20
+ __version__ = version = '0.184.3.dev8'
21
+ __version_tuple__ = version_tuple = (0, 184, 3, 'dev8')
sqlmesh/cli/main.py CHANGED
@@ -906,6 +906,11 @@ def create_external_models(obj: Context, **kwargs: t.Any) -> None:
906
906
  is_flag=True,
907
907
  help="Disable the check for a primary key (grain) that is missing or is not unique.",
908
908
  )
909
+ @click.option(
910
+ "--warn-grain-check",
911
+ is_flag=True,
912
+ help="Warn if any selected model is missing a grain, and compute diffs for the remaining models.",
913
+ )
909
914
  @click.option(
910
915
  "--temp-schema",
911
916
  type=str,
sqlmesh/core/context.py CHANGED
@@ -1629,6 +1629,7 @@ class GenericContext(BaseContext, t.Generic[C]):
1629
1629
  show_sample: bool = True,
1630
1630
  decimals: int = 3,
1631
1631
  skip_grain_check: bool = False,
1632
+ warn_grain_check: bool = False,
1632
1633
  temp_schema: t.Optional[str] = None,
1633
1634
  ) -> t.List[TableDiff]:
1634
1635
  """Show a diff between two tables.
@@ -1703,22 +1704,29 @@ class GenericContext(BaseContext, t.Generic[C]):
1703
1704
  target_env.naming_info, adapter.dialect
1704
1705
  )
1705
1706
  model_on = on or model.on
1706
- models_to_diff.append((model, adapter, source, target, model_on))
1707
1707
  if not model_on:
1708
1708
  models_without_grain.append(model)
1709
+ else:
1710
+ models_to_diff.append((model, adapter, source, target, model_on))
1711
+
1712
+ if models_without_grain:
1713
+ model_names = "\n".join(
1714
+ f"─ {model.name} \n at '{model._path}'" for model in models_without_grain
1715
+ )
1716
+ message = (
1717
+ "SQLMesh doesn't know how to join the tables for the following models:\n"
1718
+ f"{model_names}\n\n"
1719
+ "Please specify a `grain` in each model definition. It must be unique and not null."
1720
+ )
1721
+ if warn_grain_check:
1722
+ self.console.log_warning(message)
1723
+ else:
1724
+ raise SQLMeshError(message)
1709
1725
 
1710
1726
  if models_to_diff:
1711
1727
  self.console.show_table_diff_details(
1712
1728
  [model[0].name for model in models_to_diff],
1713
1729
  )
1714
- if models_without_grain:
1715
- model_names = "\n".join(
1716
- f"─ {model.name} \n at '{model._path}'" for model in models_without_grain
1717
- )
1718
- raise SQLMeshError(
1719
- f"SQLMesh doesn't know how to join the tables for the following models:\n{model_names}\n"
1720
- "\nPlease specify the `grain` in each model definition. Must be unique and not null."
1721
- )
1722
1730
 
1723
1731
  self.console.start_table_diff_progress(len(models_to_diff))
1724
1732
  try:
sqlmesh/magics.py CHANGED
@@ -702,6 +702,11 @@ class SQLMeshMagics(Magics):
702
702
  action="store_true",
703
703
  help="Disable the check for a primary key (grain) that is missing or is not unique.",
704
704
  )
705
+ @argument(
706
+ "--warn-grain-check",
707
+ action="store_true",
708
+ help="Warn if any selected model is missing a grain, and compute diffs for the remaining models.",
709
+ )
705
710
  @line_magic
706
711
  @pass_sqlmesh_context
707
712
  def table_diff(self, context: Context, line: str) -> None:
@@ -723,6 +728,7 @@ class SQLMeshMagics(Magics):
723
728
  show_sample=args.show_sample,
724
729
  decimals=args.decimals,
725
730
  skip_grain_check=args.skip_grain_check,
731
+ warn_grain_check=args.warn_grain_check,
726
732
  )
727
733
 
728
734
  @magic_arguments()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.184.3.dev7
3
+ Version: 0.184.3.dev8
4
4
  Summary: Next-generation data transformation framework
5
5
  Author-email: "TobikoData Inc." <engineering@tobikodata.com>
6
6
  License: Apache License
@@ -1,19 +1,19 @@
1
1
  sqlmesh/__init__.py,sha256=DRovDXI-9D9xeYDP7t8Fq7mI31S2btlN-LHPOK3y7PA,7240
2
- sqlmesh/_version.py,sha256=wCcNH4RxigwqFPQXeawvwvS-ltCkaU9FF0vYOjZ6SgA,528
3
- sqlmesh/magics.py,sha256=9oY1Uz8uwsuTtPRg9HTYDxnGiJ7-OVRCpmCgAhbKHUU,39431
2
+ sqlmesh/_version.py,sha256=G-Qj79bNfZsBHFjCfEWLkulXh3jC0q8DQtoh864eDRM,528
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
6
6
  sqlmesh/cicd/bot.py,sha256=2zlbn-DXkqQzr3lA0__IGU4XaIfXBXBKLWXNI2DRJX8,759
7
7
  sqlmesh/cicd/config.py,sha256=mpgkisSBBovlNrNZir2unT8Wes6b38RW2UsU_o4e8vY,109
8
8
  sqlmesh/cli/__init__.py,sha256=MAXAyO7isbyM-PaSdFjkJNcjn32WjOl0XzxT5gvp_vo,1690
9
9
  sqlmesh/cli/example_project.py,sha256=QAFQbw_kzqn30GLTthqsuWXbFDBpX8W6RsCgQ-jx65M,9308
10
- sqlmesh/cli/main.py,sha256=z1Af0bwqtnYHzkY0_9REpaJe-onxvXN4rLw6upyxKec,31979
10
+ sqlmesh/cli/main.py,sha256=TnV6htxJEvRDU7XxcXPOXNKmCT--f6k3yANeqmNSo6Y,32143
11
11
  sqlmesh/cli/options.py,sha256=aC_L5WnMScKzMU55BD1Y-8R-QzqCkPSYrlCI-payHRA,1333
12
12
  sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  sqlmesh/core/_typing.py,sha256=e1f7xO2aZCy38M_3VoDy-XI3shyd99-IFctgIFSgXWM,497
14
14
  sqlmesh/core/console.py,sha256=o5TSVb9rN0ygerS-CeWaZTIblaa7u-OZotucwTBu4ik,150790
15
15
  sqlmesh/core/constants.py,sha256=oqt6zjepUhQoWlgapKn_HpG7Pu9mrFwepdX5caNfJUI,2499
16
- sqlmesh/core/context.py,sha256=kLKXwOLc_5Orv-SxvI0zbpL9ZJ0XkB9HZgd9R6uh-9Y,114691
16
+ sqlmesh/core/context.py,sha256=r7wKGFx702NF06S0Y8AvkoMaeYjzDRcugArRwxT4LHU,114911
17
17
  sqlmesh/core/context_diff.py,sha256=s9toP17d4tJfOpFH91LcjGK2CM64PVuB0MPkeFgF4hQ,20415
18
18
  sqlmesh/core/dialect.py,sha256=fPTV517IOS0nWMxYznNNQnXkQkFFrPOSKe8ghsQ0o8A,49759
19
19
  sqlmesh/core/environment.py,sha256=0TTQf4C4LXwf37fm-dfYv1qyG7vtZfQI5rizgm5g0j0,11442
@@ -267,7 +267,7 @@ sqlmesh/utils/pandas.py,sha256=uKI-ygEtMcGDRzXdBu0RkGmMBkYxwu5O2Wabho841Ls,2196
267
267
  sqlmesh/utils/pydantic.py,sha256=-u69PDY-4FLR7ODNKBoN7PsPNmZ0wdhsJcCAG2P6vyY,11061
268
268
  sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
269
269
  sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
270
- sqlmesh-0.184.3.dev7.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
270
+ sqlmesh-0.184.3.dev8.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
271
271
  web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
272
272
  web/client/dist/index.html,sha256=h-jIuvBTQ-QurWEds39umXiJjP_TWPQmkHTiizCAeOI,5472
273
273
  web/client/dist/assets/Audits-DIPZFtrx.js,sha256=Yn24xPBT3znH0fQJJaBLb1p1wjJz1nWjrZcm18e63W0,1041
@@ -385,8 +385,8 @@ web/server/api/endpoints/models.py,sha256=SzS5bshzdXyM6hb948sZ_3k-xhpGCHkxkb7pHz
385
385
  web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
386
386
  web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
387
387
  web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
388
- sqlmesh-0.184.3.dev7.dist-info/METADATA,sha256=BilnWvEsvEwJCWWi_vBKdrgGaLnBCEJPnfqfGjekx7M,25498
389
- sqlmesh-0.184.3.dev7.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
390
- sqlmesh-0.184.3.dev7.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
391
- sqlmesh-0.184.3.dev7.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
392
- sqlmesh-0.184.3.dev7.dist-info/RECORD,,
388
+ sqlmesh-0.184.3.dev8.dist-info/METADATA,sha256=939HceRm9epgPpYaxrLuwzn79Y6J6mb50EvkxUqEiR0,25498
389
+ sqlmesh-0.184.3.dev8.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
390
+ sqlmesh-0.184.3.dev8.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
391
+ sqlmesh-0.184.3.dev8.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
392
+ sqlmesh-0.184.3.dev8.dist-info/RECORD,,