snowflake-cli-labs 2.7.0rc1__py3-none-any.whl → 2.7.0rc2__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.
- snowflake/cli/__about__.py +1 -1
- snowflake/cli/api/config.py +1 -0
- snowflake/cli/api/feature_flags.py +6 -1
- snowflake/cli/plugins/connection/commands.py +9 -0
- snowflake/cli/plugins/streamlit/manager.py +20 -8
- {snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/METADATA +1 -1
- {snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/RECORD +10 -10
- {snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/WHEEL +0 -0
- {snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/entry_points.txt +0 -0
- {snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/licenses/LICENSE +0 -0
snowflake/cli/__about__.py
CHANGED
snowflake/cli/api/config.py
CHANGED
|
@@ -48,4 +48,9 @@ class FeatureFlag(FeatureFlagMixin):
|
|
|
48
48
|
ENABLE_STREAMLIT_EMBEDDED_STAGE = BooleanFlag(
|
|
49
49
|
"ENABLE_STREAMLIT_EMBEDDED_STAGE", False
|
|
50
50
|
)
|
|
51
|
-
|
|
51
|
+
ENABLE_STREAMLIT_NO_CHECKOUTS = BooleanFlag("ENABLE_STREAMLIT_NO_CHECKOUTS", False)
|
|
52
|
+
ENABLE_STREAMLIT_VERSIONED_STAGE = BooleanFlag(
|
|
53
|
+
"ENABLE_STREAMLIT_VERSIONED_STAGE", False
|
|
54
|
+
)
|
|
55
|
+
# TODO: remove in 3.0
|
|
56
|
+
ENABLE_PROJECT_DEFINITION_V2 = BooleanFlag("ENABLE_PROJECT_DEFINITION_V2", True)
|
|
@@ -219,6 +219,14 @@ def add(
|
|
|
219
219
|
prompt="Path to private key file",
|
|
220
220
|
help="Path to file containing private key",
|
|
221
221
|
),
|
|
222
|
+
token_file_path: str = typer.Option(
|
|
223
|
+
EmptyInput(),
|
|
224
|
+
"--token-file-path",
|
|
225
|
+
"-t",
|
|
226
|
+
click_type=OptionalPrompt(),
|
|
227
|
+
prompt="Path to token file",
|
|
228
|
+
help="Path to file with an OAuth token that should be used when connecting to Snowflake",
|
|
229
|
+
),
|
|
222
230
|
set_as_default: bool = typer.Option(
|
|
223
231
|
False,
|
|
224
232
|
"--default",
|
|
@@ -246,6 +254,7 @@ def add(
|
|
|
246
254
|
role=role,
|
|
247
255
|
authenticator=authenticator,
|
|
248
256
|
private_key_path=private_key_path,
|
|
257
|
+
token_file_path=token_file_path,
|
|
249
258
|
),
|
|
250
259
|
)
|
|
251
260
|
if set_as_default:
|
|
@@ -121,10 +121,11 @@ class StreamlitManager(SqlExecutionMixin):
|
|
|
121
121
|
# for backwards compatibility - quoted stage path might be case-sensitive
|
|
122
122
|
# https://docs.snowflake.com/en/sql-reference/identifiers-syntax#double-quoted-identifiers
|
|
123
123
|
streamlit_name_for_root_location = streamlit_id.name
|
|
124
|
-
|
|
124
|
+
use_versioned_stage = FeatureFlag.ENABLE_STREAMLIT_VERSIONED_STAGE.is_enabled()
|
|
125
125
|
if (
|
|
126
126
|
experimental_behaviour_enabled()
|
|
127
127
|
or FeatureFlag.ENABLE_STREAMLIT_EMBEDDED_STAGE.is_enabled()
|
|
128
|
+
or use_versioned_stage
|
|
128
129
|
):
|
|
129
130
|
"""
|
|
130
131
|
1. Create streamlit object
|
|
@@ -141,19 +142,30 @@ class StreamlitManager(SqlExecutionMixin):
|
|
|
141
142
|
title=title,
|
|
142
143
|
)
|
|
143
144
|
try:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
if use_versioned_stage:
|
|
146
|
+
self._execute_query(
|
|
147
|
+
f"ALTER STREAMLIT {streamlit_id.identifier} ADD LIVE VERSION FROM LAST"
|
|
148
|
+
)
|
|
149
|
+
elif not FeatureFlag.ENABLE_STREAMLIT_NO_CHECKOUTS.is_enabled():
|
|
150
|
+
self._execute_query(
|
|
151
|
+
f"ALTER streamlit {streamlit_id.identifier} CHECKOUT"
|
|
152
|
+
)
|
|
147
153
|
except ProgrammingError as e:
|
|
148
|
-
# If an error is raised because a CHECKOUT has already occurred,
|
|
149
|
-
|
|
150
|
-
|
|
154
|
+
# If an error is raised because a CHECKOUT has already occurred or a LIVE VERSION already exists, simply skip it and continue
|
|
155
|
+
if "Checkout already exists" in str(
|
|
156
|
+
e
|
|
157
|
+
) or "There is already a live version" in str(e):
|
|
151
158
|
log.info("Checkout already exists, continuing")
|
|
152
159
|
else:
|
|
153
160
|
raise
|
|
161
|
+
|
|
154
162
|
stage_path = streamlit_id.identifier
|
|
155
163
|
embedded_stage_name = f"snow://streamlit/{stage_path}"
|
|
156
|
-
|
|
164
|
+
if use_versioned_stage:
|
|
165
|
+
# "LIVE" is the only supported version for now, but this may change later.
|
|
166
|
+
root_location = f"{embedded_stage_name}/versions/live"
|
|
167
|
+
else:
|
|
168
|
+
root_location = f"{embedded_stage_name}/default_checkout"
|
|
157
169
|
|
|
158
170
|
self._put_streamlit_files(
|
|
159
171
|
root_location,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
snowflake/cli/__about__.py,sha256=
|
|
1
|
+
snowflake/cli/__about__.py,sha256=Uv-6PLfi16rouu4FmVaYcQxzWlnqxuynvd1zCdCUdao,636
|
|
2
2
|
snowflake/cli/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
|
|
3
3
|
snowflake/cli/api/__init__.py,sha256=kD6lYv5et7QJvW7vzvLN9p2ibfD7pjh9KRWsp2QoYqo,1330
|
|
4
4
|
snowflake/cli/api/cli_global_context.py,sha256=gAs7snaqRi5ESaxU8HcC_QBR2q9y1PMdhi7kQCGkICs,11714
|
|
5
|
-
snowflake/cli/api/config.py,sha256
|
|
5
|
+
snowflake/cli/api/config.py,sha256=-CmOMU14fEgI3oba00WU27RiwG46yc1UkgcI6Rdoxew,10993
|
|
6
6
|
snowflake/cli/api/constants.py,sha256=nVcX-NNZBFUIDX3Gbgm_YKjzv8tgcd1JdYvicV-nL_A,2964
|
|
7
7
|
snowflake/cli/api/errno.py,sha256=IvotDJv_m_lz4tf5es0q7qRSdzCxv3zd2X2bQP6KsNU,1015
|
|
8
8
|
snowflake/cli/api/exceptions.py,sha256=syNz7HdRVs3hAVC2NUaQINlSo-Ge-WEceuFvLoau2eQ,5118
|
|
9
|
-
snowflake/cli/api/feature_flags.py,sha256=
|
|
9
|
+
snowflake/cli/api/feature_flags.py,sha256=RXQERhm4BIwmCrt7peHCNQafw1-IVnTynQsDUB6AXjk,1725
|
|
10
10
|
snowflake/cli/api/identifiers.py,sha256=dBIKuCW5d8xoBbNPE_YnBab58B3b0pYNIfjuzpQPTug,5433
|
|
11
11
|
snowflake/cli/api/rest_api.py,sha256=X2hYq-J2mZJmVIEeCUvdk8ccTiV86ltVlj9ac5ZmIak,6070
|
|
12
12
|
snowflake/cli/api/sanitizers.py,sha256=7EKqVQ3KOob0IFFoc_GmXPYpRhgnmIqhnJSvHPgxM5I,1211
|
|
@@ -107,7 +107,7 @@ snowflake/cli/app/dev/docs/templates/overview.rst.jinja2,sha256=FO4HljkNnG33gliz
|
|
|
107
107
|
snowflake/cli/app/dev/docs/templates/usage.rst.jinja2,sha256=iQIcaX0ZPLc4lJRRbFxmHSkuFHIC7gOzQVfv800w4rM,2018
|
|
108
108
|
snowflake/cli/plugins/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
|
|
109
109
|
snowflake/cli/plugins/connection/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
|
|
110
|
-
snowflake/cli/plugins/connection/commands.py,sha256=
|
|
110
|
+
snowflake/cli/plugins/connection/commands.py,sha256=2YCr2gJzZJGR4192lfQSWWValslXAC28tA08Ps9sY3g,9723
|
|
111
111
|
snowflake/cli/plugins/connection/plugin_spec.py,sha256=CyVfzPV-5WJ60vVqO8Z2ULbe_tjDJh03v9HGZW3M0Hc,998
|
|
112
112
|
snowflake/cli/plugins/connection/util.py,sha256=2X8aCsfWmb1HTZdljSGNQxB3AwwuBcWf4jHmdZUeoFA,6166
|
|
113
113
|
snowflake/cli/plugins/cortex/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
|
|
@@ -212,7 +212,7 @@ snowflake/cli/plugins/stage/manager.py,sha256=r93oM5g-2rpXM7F7qtW00KlTmwCxKi7374
|
|
|
212
212
|
snowflake/cli/plugins/stage/plugin_spec.py,sha256=r8fvJxonf1TYBUm2361ka9fpsnA35NQRbGYqhKVfaC4,993
|
|
213
213
|
snowflake/cli/plugins/streamlit/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
|
|
214
214
|
snowflake/cli/plugins/streamlit/commands.py,sha256=e6wkD2HyWH39S05q6YlHzvzLAhyph6gmltHxuWOc8ao,5975
|
|
215
|
-
snowflake/cli/plugins/streamlit/manager.py,sha256=
|
|
215
|
+
snowflake/cli/plugins/streamlit/manager.py,sha256=oz9Rc_3g9ZnxKN_Y0fvlxxOvYGJVVtUgQoTzkmE85Pw,8272
|
|
216
216
|
snowflake/cli/plugins/streamlit/plugin_spec.py,sha256=ZVxF6J5PFkjOtzBpsGk1YVL-XBXYgpTly5X-FMVYq9I,997
|
|
217
217
|
snowflake/cli/plugins/workspace/__init__.py,sha256=uGA_QRGW3iGwaegpFsLgOhup0zBliBSXh9ou8J439uU,578
|
|
218
218
|
snowflake/cli/plugins/workspace/commands.py,sha256=M552euR-Z-rmed88mfin_Cso1X0Y15zdHIg8s_fbxZg,1224
|
|
@@ -230,8 +230,8 @@ snowflake/cli/templates/default_streamlit/snowflake.yml,sha256=yWFU-vqJ7Z17K3loU
|
|
|
230
230
|
snowflake/cli/templates/default_streamlit/streamlit_app.py,sha256=hfYtJl4Rtm0n3J2gNeDwMT-leeGL5R-qJKwyJ0kUxAI,109
|
|
231
231
|
snowflake/cli/templates/default_streamlit/common/hello.py,sha256=3Zt2LthAYDs6UGqOvRNCzYH-HISLHxdx_uAVhcCOtJM,37
|
|
232
232
|
snowflake/cli/templates/default_streamlit/pages/my_page.py,sha256=f__P9j5XCo8J1c6du25wSvknIKvhTFWrXF_298YiQbw,49
|
|
233
|
-
snowflake_cli_labs-2.7.
|
|
234
|
-
snowflake_cli_labs-2.7.
|
|
235
|
-
snowflake_cli_labs-2.7.
|
|
236
|
-
snowflake_cli_labs-2.7.
|
|
237
|
-
snowflake_cli_labs-2.7.
|
|
233
|
+
snowflake_cli_labs-2.7.0rc2.dist-info/METADATA,sha256=098gUXYelbDm6UjtsbMOhcNOyl5YdPSfL1r2dO7f9Pg,17804
|
|
234
|
+
snowflake_cli_labs-2.7.0rc2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
235
|
+
snowflake_cli_labs-2.7.0rc2.dist-info/entry_points.txt,sha256=_qdnT44fYFbH78kb6Em5jr2_26amIg3UIAvSdmqT6TY,57
|
|
236
|
+
snowflake_cli_labs-2.7.0rc2.dist-info/licenses/LICENSE,sha256=mJMA3Uz2AbjU_kVggo1CAx01XhBsI7BSi2H7ggUg_-c,11344
|
|
237
|
+
snowflake_cli_labs-2.7.0rc2.dist-info/RECORD,,
|
|
File without changes
|
{snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{snowflake_cli_labs-2.7.0rc1.dist-info → snowflake_cli_labs-2.7.0rc2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|