snowflake-cli 3.8.1__py3-none-any.whl → 3.8.3__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.
@@ -16,7 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  from enum import Enum, unique
18
18
 
19
- VERSION = "3.8.1"
19
+ VERSION = "3.8.3"
20
20
 
21
21
 
22
22
  @unique
@@ -190,9 +190,9 @@ class ApplicationPackageEntityModel(EntityModelBaseWithArtifacts):
190
190
  title="Entities that will be bundled and deployed as part of this application package",
191
191
  default=[],
192
192
  )
193
- enable_release_channels: bool = Field(
193
+ enable_release_channels: Optional[bool] = Field(
194
194
  title="Enable release channels for this application package",
195
- default=False,
195
+ default=None,
196
196
  )
197
197
 
198
198
  @field_validator("children")
@@ -1559,13 +1559,16 @@ class ApplicationPackageEntity(EntityBase[ApplicationPackageEntityModel]):
1559
1559
  If return value is None, it means do not explicitly set the flag.
1560
1560
  """
1561
1561
  value_from_snowflake_yml = self.model.enable_release_channels
1562
- feature_flag_from_config = FeatureFlag.ENABLE_RELEASE_CHANNELS.is_enabled()
1563
- if feature_flag_from_config and not value_from_snowflake_yml:
1564
- self._workspace_ctx.console.warning(
1565
- f"{FeatureFlag.ENABLE_RELEASE_CHANNELS.name} value in config.toml is deprecated."
1566
- f" Set [enable_release_channels] for the application package in snowflake.yml instead."
1567
- )
1568
- enable_release_channels = value_from_snowflake_yml or feature_flag_from_config
1562
+ feature_flag_from_config = FeatureFlag.ENABLE_RELEASE_CHANNELS.get_value()
1563
+ if value_from_snowflake_yml is not None:
1564
+ enable_release_channels = value_from_snowflake_yml
1565
+ else:
1566
+ enable_release_channels = feature_flag_from_config
1567
+ if feature_flag_from_config is not None:
1568
+ self._workspace_ctx.console.warning(
1569
+ f"{FeatureFlag.ENABLE_RELEASE_CHANNELS.name} value in config.toml is deprecated."
1570
+ f" Set [enable_release_channels] for the application package in snowflake.yml instead."
1571
+ )
1569
1572
 
1570
1573
  feature_enabled_in_account = (
1571
1574
  get_snowflake_facade().get_ui_parameter(
@@ -24,6 +24,14 @@ app = SnowTyperFactory(
24
24
  short_help="Manages image registries.",
25
25
  )
26
26
 
27
+ import typer
28
+
29
+ PrivateLinkOption: bool = typer.Option(
30
+ False,
31
+ "--private-link",
32
+ help="Get the private link URL instead of the public URL.",
33
+ )
34
+
27
35
 
28
36
  _TOKEN_EPILOG = """\
29
37
  Usage Example: snow spcs image-registry token --format JSON | docker login $(snow spcs image-registry url) -u 0sessiontoken --password-stdin
@@ -46,13 +54,13 @@ def token(**options) -> ObjectResult:
46
54
 
47
55
 
48
56
  @app.command(requires_connection=True)
49
- def url(**options) -> MessageResult:
57
+ def url(private_link: bool = PrivateLinkOption, **options) -> MessageResult:
50
58
  """
51
59
  Gets the image registry URL for the current account.
52
60
 
53
61
  Must be called from a role that can view at least one image repository in the image registry.
54
62
  """
55
- return MessageResult(RegistryManager().get_registry_url())
63
+ return MessageResult(RegistryManager().get_registry_url(private_link))
56
64
 
57
65
 
58
66
  @app.command(requires_connection=True)
@@ -73,7 +73,7 @@ class RegistryManager(SqlExecutionMixin):
73
73
  def _has_url_scheme(self, url: str):
74
74
  return re.fullmatch(r"^.*//.+", url) is not None
75
75
 
76
- def get_registry_url(self) -> str:
76
+ def get_registry_url(self, private_link: bool = False) -> str:
77
77
  images_query = "show image repositories in schema snowflake.images;"
78
78
  images_result = self.execute_query(images_query, cursor_class=DictCursor)
79
79
 
@@ -88,7 +88,15 @@ class RegistryManager(SqlExecutionMixin):
88
88
  if not results:
89
89
  raise NoImageRepositoriesFoundError()
90
90
 
91
- sample_repository_url = results["repository_url"]
91
+ if private_link:
92
+ privatelink_repository_url = "privatelink_repository_url"
93
+
94
+ if privatelink_repository_url not in results:
95
+ return ""
96
+ sample_repository_url = results[privatelink_repository_url]
97
+ else:
98
+ sample_repository_url = results["repository_url"]
99
+
92
100
  if not self._has_url_scheme(sample_repository_url):
93
101
  sample_repository_url = f"//{sample_repository_url}"
94
102
  return urlparse(sample_repository_url).netloc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snowflake-cli
3
- Version: 3.8.1
3
+ Version: 3.8.3
4
4
  Summary: Snowflake CLI
5
5
  Project-URL: Source code, https://github.com/snowflakedb/snowflake-cli
6
6
  Project-URL: Bug Tracker, https://github.com/snowflakedb/snowflake-cli/issues
@@ -1,4 +1,4 @@
1
- snowflake/cli/__about__.py,sha256=Q94pj-VUidjXzdOKOk2fWbbmhed0WEnlNGNRg_A8mDE,852
1
+ snowflake/cli/__about__.py,sha256=vo4Y2IjCu3t8SBhzMac_KvSAae1j682mmLovxzEhMW8,852
2
2
  snowflake/cli/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
3
3
  snowflake/cli/_app/__init__.py,sha256=CR_uTgoqHnU1XdyRhm5iQsS86yWXGVx5Ht7aGSDNFmc,765
4
4
  snowflake/cli/_app/__main__.py,sha256=ZmcFdFqAtk2mFMz-cqCFdGd0iYzc7UsLH1oT1U40S0k,858
@@ -89,7 +89,7 @@ snowflake/cli/_plugins/nativeapp/codegen/snowpark/python_processor.py,sha256=Ltw
89
89
  snowflake/cli/_plugins/nativeapp/codegen/templates/templates_processor.py,sha256=ycaMiMfJuyW8QntKlfXOrKOxfGsk4zngGbTFuwZDfVU,4704
90
90
  snowflake/cli/_plugins/nativeapp/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
91
  snowflake/cli/_plugins/nativeapp/entities/application.py,sha256=p5DrEKoO5ojvBSm0LB13ubFLMCM4MV1rbX5wZqbTO-s,40473
92
- snowflake/cli/_plugins/nativeapp/entities/application_package.py,sha256=GSbBJc-iM-ryS93twFklldcIT9e5A57DVQcO07ihDYs,70401
92
+ snowflake/cli/_plugins/nativeapp/entities/application_package.py,sha256=slb1K5EJdQJPK_YJiUQX1JYnQYGw5XI6qZM10D1VzdQ,70510
93
93
  snowflake/cli/_plugins/nativeapp/entities/application_package_child_interface.py,sha256=tN5UmU6wD_P14k7_MtOFNJwNUi6LfwFAUdnyZ4_O9hk,1527
94
94
  snowflake/cli/_plugins/nativeapp/entities/models/event_sharing_telemetry.py,sha256=ASfuzBheevYrKzP8_mvbq1SR1gSaui1xlZVg4dD0hpg,2364
95
95
  snowflake/cli/_plugins/nativeapp/release_channel/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
@@ -149,8 +149,8 @@ snowflake/cli/_plugins/spcs/compute_pool/compute_pool_entity.py,sha256=Uf1B26_AR
149
149
  snowflake/cli/_plugins/spcs/compute_pool/compute_pool_entity_model.py,sha256=XnI8hPeaXQ7d3AtOQVtYVnvWhGuDz6bhYSD2Uji1HqU,1639
150
150
  snowflake/cli/_plugins/spcs/compute_pool/manager.py,sha256=pf8fXBf84Snw6grHE31Rdj0HYNYKAQHRxgGQ7cnSNlk,6013
151
151
  snowflake/cli/_plugins/spcs/image_registry/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
152
- snowflake/cli/_plugins/spcs/image_registry/commands.py,sha256=W2FxH8ugY-LO8yOs5TWCNfi7DKmTmCOFTJwk-rpEsnw,2425
153
- snowflake/cli/_plugins/spcs/image_registry/manager.py,sha256=2AWGhHmMih_yaTnoT25LN2Zja-Vq1SyFgFISEq-d40o,4312
152
+ snowflake/cli/_plugins/spcs/image_registry/commands.py,sha256=W2AKp8i5Wmyys2H2x-ORJt7oEmmxzbnMPsyS5wq2e_g,2631
153
+ snowflake/cli/_plugins/spcs/image_registry/manager.py,sha256=8ZI2PhiyIsiskK0RdguBKK5GoDkgTk27Wg5brQgKA9M,4611
154
154
  snowflake/cli/_plugins/spcs/image_repository/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
155
155
  snowflake/cli/_plugins/spcs/image_repository/commands.py,sha256=SVLrqwl9iVA74GSRCY8ATVfW164Ay3b_GkHUdSY9qpg,6391
156
156
  snowflake/cli/_plugins/spcs/image_repository/image_repository_entity.py,sha256=GT2h1xkefD6js38uYbZYN_NjBffJqBBZrz6-F5zyJPs,260
@@ -285,8 +285,8 @@ snowflake/cli/api/utils/path_utils.py,sha256=OgR7cwbHXqP875RgPJGrAvDC1RRTU-2-Yss
285
285
  snowflake/cli/api/utils/python_api_utils.py,sha256=wTNxXrma78wPvBz-Jo-ixNtP8ZjDCDh4TvciEnhYIAM,300
286
286
  snowflake/cli/api/utils/templating_functions.py,sha256=zu2oK1BEC9yyWtDx17Hr-VAYHvCtagaOdxIrm70JQys,4955
287
287
  snowflake/cli/api/utils/types.py,sha256=fVKuls8axKSsBzPqWwrkwkwoXXmedqxNJKqfXrrGyBM,1190
288
- snowflake_cli-3.8.1.dist-info/METADATA,sha256=jxJ91kz4D_OUUrtvMW6Egos_96y4ejECxIArXKoNNUM,18316
289
- snowflake_cli-3.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
290
- snowflake_cli-3.8.1.dist-info/entry_points.txt,sha256=6QmSI0wUX6p7f-dGvrPdswlQyVAVGi1AtOUbE8X6bho,58
291
- snowflake_cli-3.8.1.dist-info/licenses/LICENSE,sha256=mJMA3Uz2AbjU_kVggo1CAx01XhBsI7BSi2H7ggUg_-c,11344
292
- snowflake_cli-3.8.1.dist-info/RECORD,,
288
+ snowflake_cli-3.8.3.dist-info/METADATA,sha256=qF-mPBZxbJlpYd_ru9dfzzZaFMd40ofJwaQReUbhCyQ,18316
289
+ snowflake_cli-3.8.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
290
+ snowflake_cli-3.8.3.dist-info/entry_points.txt,sha256=6QmSI0wUX6p7f-dGvrPdswlQyVAVGi1AtOUbE8X6bho,58
291
+ snowflake_cli-3.8.3.dist-info/licenses/LICENSE,sha256=mJMA3Uz2AbjU_kVggo1CAx01XhBsI7BSi2H7ggUg_-c,11344
292
+ snowflake_cli-3.8.3.dist-info/RECORD,,