snowflake-cli-labs 3.0.0rc4__py3-none-any.whl → 3.0.1__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.
- README.md +21 -0
- {snowflake_cli_labs-3.0.0rc4.dist-info → snowflake_cli_labs-3.0.1.dist-info}/METADATA +6 -96
- snowflake_cli_labs-3.0.1.dist-info/RECORD +5 -0
- snowflake/cli/__about__.py +0 -17
- snowflake/cli/__init__.py +0 -13
- snowflake/cli/_app/__init__.py +0 -22
- snowflake/cli/_app/__main__.py +0 -31
- snowflake/cli/_app/api_impl/__init__.py +0 -13
- snowflake/cli/_app/api_impl/plugin/__init__.py +0 -13
- snowflake/cli/_app/api_impl/plugin/plugin_config_provider_impl.py +0 -66
- snowflake/cli/_app/cli_app.py +0 -252
- snowflake/cli/_app/commands_registration/__init__.py +0 -33
- snowflake/cli/_app/commands_registration/builtin_plugins.py +0 -50
- snowflake/cli/_app/commands_registration/command_plugins_loader.py +0 -169
- snowflake/cli/_app/commands_registration/commands_registration_with_callbacks.py +0 -105
- snowflake/cli/_app/commands_registration/exception_logging.py +0 -26
- snowflake/cli/_app/commands_registration/threadsafe.py +0 -48
- snowflake/cli/_app/commands_registration/typer_registration.py +0 -153
- snowflake/cli/_app/constants.py +0 -19
- snowflake/cli/_app/dev/__init__.py +0 -13
- snowflake/cli/_app/dev/commands_structure.py +0 -48
- snowflake/cli/_app/dev/docs/__init__.py +0 -13
- snowflake/cli/_app/dev/docs/commands_docs_generator.py +0 -118
- snowflake/cli/_app/dev/docs/generator.py +0 -35
- snowflake/cli/_app/dev/docs/project_definition_docs_generator.py +0 -58
- snowflake/cli/_app/dev/docs/project_definition_generate_json_schema.py +0 -227
- snowflake/cli/_app/dev/docs/template_utils.py +0 -23
- snowflake/cli/_app/dev/docs/templates/definition_description.rst.jinja2 +0 -38
- snowflake/cli/_app/dev/docs/templates/overview.rst.jinja2 +0 -9
- snowflake/cli/_app/dev/docs/templates/usage.rst.jinja2 +0 -67
- snowflake/cli/_app/dev/pycharm_remote_debug.py +0 -46
- snowflake/cli/_app/loggers.py +0 -199
- snowflake/cli/_app/main_typer.py +0 -62
- snowflake/cli/_app/printing.py +0 -181
- snowflake/cli/_app/secret.py +0 -9
- snowflake/cli/_app/snow_connector.py +0 -309
- snowflake/cli/_app/telemetry.py +0 -220
- snowflake/cli/_app/version_check.py +0 -74
- snowflake/cli/_plugins/__init__.py +0 -13
- snowflake/cli/_plugins/connection/__init__.py +0 -13
- snowflake/cli/_plugins/connection/commands.py +0 -353
- snowflake/cli/_plugins/connection/plugin_spec.py +0 -30
- snowflake/cli/_plugins/connection/util.py +0 -195
- snowflake/cli/_plugins/cortex/__init__.py +0 -13
- snowflake/cli/_plugins/cortex/commands.py +0 -332
- snowflake/cli/_plugins/cortex/constants.py +0 -17
- snowflake/cli/_plugins/cortex/manager.py +0 -189
- snowflake/cli/_plugins/cortex/plugin_spec.py +0 -30
- snowflake/cli/_plugins/cortex/types.py +0 -22
- snowflake/cli/_plugins/git/__init__.py +0 -13
- snowflake/cli/_plugins/git/commands.py +0 -358
- snowflake/cli/_plugins/git/manager.py +0 -151
- snowflake/cli/_plugins/git/plugin_spec.py +0 -30
- snowflake/cli/_plugins/helpers/__init__.py +0 -13
- snowflake/cli/_plugins/helpers/commands.py +0 -61
- snowflake/cli/_plugins/helpers/plugin_spec.py +0 -30
- snowflake/cli/_plugins/init/__init__.py +0 -13
- snowflake/cli/_plugins/init/commands.py +0 -248
- snowflake/cli/_plugins/init/plugin_spec.py +0 -30
- snowflake/cli/_plugins/nativeapp/__init__.py +0 -13
- snowflake/cli/_plugins/nativeapp/artifacts.py +0 -757
- snowflake/cli/_plugins/nativeapp/bundle_context.py +0 -31
- snowflake/cli/_plugins/nativeapp/codegen/__init__.py +0 -13
- snowflake/cli/_plugins/nativeapp/codegen/artifact_processor.py +0 -91
- snowflake/cli/_plugins/nativeapp/codegen/compiler.py +0 -149
- snowflake/cli/_plugins/nativeapp/codegen/sandbox.py +0 -306
- snowflake/cli/_plugins/nativeapp/codegen/setup/native_app_setup_processor.py +0 -249
- snowflake/cli/_plugins/nativeapp/codegen/setup/setup_driver.py.source +0 -59
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/callback_source.py.jinja +0 -181
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/extension_function_utils.py +0 -217
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/models.py +0 -61
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/python_processor.py +0 -523
- snowflake/cli/_plugins/nativeapp/codegen/templates/templates_processor.py +0 -114
- snowflake/cli/_plugins/nativeapp/commands.py +0 -559
- snowflake/cli/_plugins/nativeapp/common_flags.py +0 -44
- snowflake/cli/_plugins/nativeapp/constants.py +0 -27
- snowflake/cli/_plugins/nativeapp/entities/__init__.py +0 -0
- snowflake/cli/_plugins/nativeapp/entities/application.py +0 -878
- snowflake/cli/_plugins/nativeapp/entities/application_package.py +0 -1392
- snowflake/cli/_plugins/nativeapp/exceptions.py +0 -113
- snowflake/cli/_plugins/nativeapp/feature_flags.py +0 -24
- snowflake/cli/_plugins/nativeapp/manager.py +0 -415
- snowflake/cli/_plugins/nativeapp/plugin_spec.py +0 -30
- snowflake/cli/_plugins/nativeapp/policy.py +0 -53
- snowflake/cli/_plugins/nativeapp/project_model.py +0 -211
- snowflake/cli/_plugins/nativeapp/run_processor.py +0 -184
- snowflake/cli/_plugins/nativeapp/same_account_install_method.py +0 -70
- snowflake/cli/_plugins/nativeapp/teardown_processor.py +0 -70
- snowflake/cli/_plugins/nativeapp/utils.py +0 -98
- snowflake/cli/_plugins/nativeapp/v2_conversions/v2_to_v1_decorator.py +0 -262
- snowflake/cli/_plugins/nativeapp/version/__init__.py +0 -13
- snowflake/cli/_plugins/nativeapp/version/commands.py +0 -141
- snowflake/cli/_plugins/nativeapp/version/version_processor.py +0 -98
- snowflake/cli/_plugins/notebook/__init__.py +0 -13
- snowflake/cli/_plugins/notebook/commands.py +0 -86
- snowflake/cli/_plugins/notebook/exceptions.py +0 -20
- snowflake/cli/_plugins/notebook/manager.py +0 -71
- snowflake/cli/_plugins/notebook/plugin_spec.py +0 -30
- snowflake/cli/_plugins/notebook/types.py +0 -15
- snowflake/cli/_plugins/object/__init__.py +0 -13
- snowflake/cli/_plugins/object/command_aliases.py +0 -95
- snowflake/cli/_plugins/object/commands.py +0 -180
- snowflake/cli/_plugins/object/common.py +0 -85
- snowflake/cli/_plugins/object/manager.py +0 -118
- snowflake/cli/_plugins/object/plugin_spec.py +0 -30
- snowflake/cli/_plugins/snowpark/__init__.py +0 -13
- snowflake/cli/_plugins/snowpark/commands.py +0 -450
- snowflake/cli/_plugins/snowpark/common.py +0 -268
- snowflake/cli/_plugins/snowpark/models.py +0 -150
- snowflake/cli/_plugins/snowpark/package/__init__.py +0 -13
- snowflake/cli/_plugins/snowpark/package/anaconda_packages.py +0 -199
- snowflake/cli/_plugins/snowpark/package/commands.py +0 -195
- snowflake/cli/_plugins/snowpark/package/manager.py +0 -44
- snowflake/cli/_plugins/snowpark/package/utils.py +0 -26
- snowflake/cli/_plugins/snowpark/package_utils.py +0 -354
- snowflake/cli/_plugins/snowpark/plugin_spec.py +0 -30
- snowflake/cli/_plugins/snowpark/snowpark_entity.py +0 -29
- snowflake/cli/_plugins/snowpark/snowpark_entity_model.py +0 -173
- snowflake/cli/_plugins/snowpark/snowpark_project_paths.py +0 -109
- snowflake/cli/_plugins/snowpark/snowpark_shared.py +0 -59
- snowflake/cli/_plugins/snowpark/zipper.py +0 -89
- snowflake/cli/_plugins/spcs/__init__.py +0 -33
- snowflake/cli/_plugins/spcs/common.py +0 -99
- snowflake/cli/_plugins/spcs/compute_pool/__init__.py +0 -13
- snowflake/cli/_plugins/spcs/compute_pool/commands.py +0 -241
- snowflake/cli/_plugins/spcs/compute_pool/manager.py +0 -121
- snowflake/cli/_plugins/spcs/image_registry/__init__.py +0 -13
- snowflake/cli/_plugins/spcs/image_registry/commands.py +0 -65
- snowflake/cli/_plugins/spcs/image_registry/manager.py +0 -105
- snowflake/cli/_plugins/spcs/image_repository/__init__.py +0 -13
- snowflake/cli/_plugins/spcs/image_repository/commands.py +0 -202
- snowflake/cli/_plugins/spcs/image_repository/manager.py +0 -84
- snowflake/cli/_plugins/spcs/plugin_spec.py +0 -30
- snowflake/cli/_plugins/spcs/services/__init__.py +0 -13
- snowflake/cli/_plugins/spcs/services/commands.py +0 -345
- snowflake/cli/_plugins/spcs/services/manager.py +0 -208
- snowflake/cli/_plugins/sql/__init__.py +0 -13
- snowflake/cli/_plugins/sql/commands.py +0 -86
- snowflake/cli/_plugins/sql/manager.py +0 -92
- snowflake/cli/_plugins/sql/plugin_spec.py +0 -30
- snowflake/cli/_plugins/sql/snowsql_templating.py +0 -28
- snowflake/cli/_plugins/stage/__init__.py +0 -13
- snowflake/cli/_plugins/stage/commands.py +0 -264
- snowflake/cli/_plugins/stage/diff.py +0 -280
- snowflake/cli/_plugins/stage/manager.py +0 -582
- snowflake/cli/_plugins/stage/md5.py +0 -160
- snowflake/cli/_plugins/stage/plugin_spec.py +0 -30
- snowflake/cli/_plugins/stage/utils.py +0 -54
- snowflake/cli/_plugins/streamlit/__init__.py +0 -13
- snowflake/cli/_plugins/streamlit/commands.py +0 -195
- snowflake/cli/_plugins/streamlit/manager.py +0 -220
- snowflake/cli/_plugins/streamlit/plugin_spec.py +0 -30
- snowflake/cli/_plugins/streamlit/streamlit_entity.py +0 -12
- snowflake/cli/_plugins/streamlit/streamlit_entity_model.py +0 -66
- snowflake/cli/_plugins/workspace/__init__.py +0 -13
- snowflake/cli/_plugins/workspace/action_context.py +0 -18
- snowflake/cli/_plugins/workspace/commands.py +0 -306
- snowflake/cli/_plugins/workspace/manager.py +0 -74
- snowflake/cli/_plugins/workspace/plugin_spec.py +0 -30
- snowflake/cli/api/__init__.py +0 -48
- snowflake/cli/api/cli_global_context.py +0 -247
- snowflake/cli/api/commands/__init__.py +0 -13
- snowflake/cli/api/commands/alias.py +0 -23
- snowflake/cli/api/commands/common.py +0 -25
- snowflake/cli/api/commands/decorators.py +0 -369
- snowflake/cli/api/commands/execution_metadata.py +0 -40
- snowflake/cli/api/commands/experimental_behaviour.py +0 -18
- snowflake/cli/api/commands/flags.py +0 -561
- snowflake/cli/api/commands/overrideable_parameter.py +0 -143
- snowflake/cli/api/commands/snow_typer.py +0 -247
- snowflake/cli/api/commands/utils.py +0 -18
- snowflake/cli/api/config.py +0 -380
- snowflake/cli/api/connections.py +0 -216
- snowflake/cli/api/console/__init__.py +0 -17
- snowflake/cli/api/console/abc.py +0 -94
- snowflake/cli/api/console/console.py +0 -134
- snowflake/cli/api/console/enum.py +0 -17
- snowflake/cli/api/constants.py +0 -90
- snowflake/cli/api/entities/common.py +0 -56
- snowflake/cli/api/entities/utils.py +0 -370
- snowflake/cli/api/errno.py +0 -28
- snowflake/cli/api/exceptions.py +0 -190
- snowflake/cli/api/feature_flags.py +0 -54
- snowflake/cli/api/identifiers.py +0 -190
- snowflake/cli/api/metrics.py +0 -92
- snowflake/cli/api/output/__init__.py +0 -13
- snowflake/cli/api/output/formats.py +0 -20
- snowflake/cli/api/output/types.py +0 -118
- snowflake/cli/api/plugins/__init__.py +0 -13
- snowflake/cli/api/plugins/command/__init__.py +0 -72
- snowflake/cli/api/plugins/command/plugin_hook_specs.py +0 -21
- snowflake/cli/api/plugins/plugin_config.py +0 -32
- snowflake/cli/api/project/__init__.py +0 -13
- snowflake/cli/api/project/definition.py +0 -126
- snowflake/cli/api/project/definition_conversion.py +0 -395
- snowflake/cli/api/project/definition_manager.py +0 -145
- snowflake/cli/api/project/errors.py +0 -56
- snowflake/cli/api/project/project_verification.py +0 -23
- snowflake/cli/api/project/schemas/__init__.py +0 -13
- snowflake/cli/api/project/schemas/entities/__init__.py +0 -13
- snowflake/cli/api/project/schemas/entities/common.py +0 -153
- snowflake/cli/api/project/schemas/entities/entities.py +0 -61
- snowflake/cli/api/project/schemas/project_definition.py +0 -330
- snowflake/cli/api/project/schemas/template.py +0 -77
- snowflake/cli/api/project/schemas/updatable_model.py +0 -202
- snowflake/cli/api/project/schemas/v1/__init__.py +0 -0
- snowflake/cli/api/project/schemas/v1/identifier_model.py +0 -51
- snowflake/cli/api/project/schemas/v1/native_app/__init__.py +0 -0
- snowflake/cli/api/project/schemas/v1/native_app/application.py +0 -61
- snowflake/cli/api/project/schemas/v1/native_app/native_app.py +0 -93
- snowflake/cli/api/project/schemas/v1/native_app/package.py +0 -84
- snowflake/cli/api/project/schemas/v1/native_app/path_mapping.py +0 -65
- snowflake/cli/api/project/schemas/v1/snowpark/__init__.py +0 -0
- snowflake/cli/api/project/schemas/v1/snowpark/argument.py +0 -28
- snowflake/cli/api/project/schemas/v1/snowpark/callable.py +0 -69
- snowflake/cli/api/project/schemas/v1/snowpark/snowpark.py +0 -36
- snowflake/cli/api/project/schemas/v1/streamlit/__init__.py +0 -0
- snowflake/cli/api/project/schemas/v1/streamlit/streamlit.py +0 -47
- snowflake/cli/api/project/util.py +0 -278
- snowflake/cli/api/rendering/__init__.py +0 -13
- snowflake/cli/api/rendering/jinja.py +0 -118
- snowflake/cli/api/rendering/project_definition_templates.py +0 -43
- snowflake/cli/api/rendering/project_templates.py +0 -98
- snowflake/cli/api/rendering/sql_templates.py +0 -105
- snowflake/cli/api/rest_api.py +0 -178
- snowflake/cli/api/sanitizers.py +0 -43
- snowflake/cli/api/secure_path.py +0 -360
- snowflake/cli/api/secure_utils.py +0 -118
- snowflake/cli/api/sql_execution.py +0 -280
- snowflake/cli/api/utils/__init__.py +0 -13
- snowflake/cli/api/utils/cursor.py +0 -34
- snowflake/cli/api/utils/definition_rendering.py +0 -415
- snowflake/cli/api/utils/dict_utils.py +0 -73
- snowflake/cli/api/utils/error_handling.py +0 -23
- snowflake/cli/api/utils/graph.py +0 -97
- snowflake/cli/api/utils/models.py +0 -63
- snowflake/cli/api/utils/naming_utils.py +0 -13
- snowflake/cli/api/utils/path_utils.py +0 -36
- snowflake/cli/api/utils/templating_functions.py +0 -144
- snowflake/cli/api/utils/types.py +0 -35
- snowflake_cli_labs-3.0.0rc4.dist-info/RECORD +0 -242
- snowflake_cli_labs-3.0.0rc4.dist-info/entry_points.txt +0 -2
- {snowflake_cli_labs-3.0.0rc4.dist-info → snowflake_cli_labs-3.0.1.dist-info}/WHEEL +0 -0
- {snowflake_cli_labs-3.0.0rc4.dist-info → snowflake_cli_labs-3.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import List, Optional
|
|
18
|
-
|
|
19
|
-
from pydantic import Field, field_validator
|
|
20
|
-
from snowflake.cli.api.project.schemas.entities.common import PostDeployHook
|
|
21
|
-
from snowflake.cli.api.project.schemas.updatable_model import (
|
|
22
|
-
IdentifierField,
|
|
23
|
-
UpdatableModel,
|
|
24
|
-
)
|
|
25
|
-
from snowflake.cli.api.project.util import append_test_resource_suffix
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class Application(UpdatableModel):
|
|
29
|
-
role: Optional[str] = Field(
|
|
30
|
-
title="Role to use when creating the application object and consumer-side objects",
|
|
31
|
-
default=None,
|
|
32
|
-
)
|
|
33
|
-
name: Optional[str] = Field(
|
|
34
|
-
title="Name of the application object created when you run the snow app run command",
|
|
35
|
-
default=None,
|
|
36
|
-
)
|
|
37
|
-
warehouse: Optional[str] = IdentifierField(
|
|
38
|
-
title="Name of the application object created when you run the snow app run command",
|
|
39
|
-
default=None,
|
|
40
|
-
)
|
|
41
|
-
debug: Optional[bool] = Field(
|
|
42
|
-
title="When set, forces debug_mode on/off for the deployed application object",
|
|
43
|
-
default=None,
|
|
44
|
-
)
|
|
45
|
-
post_deploy: Optional[List[PostDeployHook]] = Field(
|
|
46
|
-
title="Actions that will be executed after the application object is created/upgraded",
|
|
47
|
-
default=None,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
@field_validator("name")
|
|
51
|
-
@classmethod
|
|
52
|
-
def append_test_resource_suffix_to_name(cls, input_value: str) -> str:
|
|
53
|
-
return append_test_resource_suffix(input_value)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class ApplicationV11(Application):
|
|
57
|
-
# Templated defaults only supported in v1.1+
|
|
58
|
-
name: Optional[str] = Field(
|
|
59
|
-
title="Name of the application object created when you run the snow app run command",
|
|
60
|
-
default="<% fn.concat_ids(ctx.native_app.name, '_', fn.sanitize_id(fn.get_username('unknown_user')) | lower) %>",
|
|
61
|
-
)
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
import re
|
|
18
|
-
from typing import List, Optional, Union
|
|
19
|
-
|
|
20
|
-
from pydantic import Field, field_validator
|
|
21
|
-
from snowflake.cli.api.project.schemas.updatable_model import UpdatableModel
|
|
22
|
-
from snowflake.cli.api.project.schemas.v1.native_app.application import (
|
|
23
|
-
Application,
|
|
24
|
-
ApplicationV11,
|
|
25
|
-
)
|
|
26
|
-
from snowflake.cli.api.project.schemas.v1.native_app.package import Package, PackageV11
|
|
27
|
-
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
|
|
28
|
-
from snowflake.cli.api.project.util import (
|
|
29
|
-
SCHEMA_AND_NAME,
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class NativeApp(UpdatableModel):
|
|
34
|
-
name: str = Field(
|
|
35
|
-
title="Project identifier",
|
|
36
|
-
)
|
|
37
|
-
artifacts: List[Union[PathMapping, str]] = Field(
|
|
38
|
-
title="List of file source and destination pairs to add to the deploy root",
|
|
39
|
-
)
|
|
40
|
-
bundle_root: Optional[str] = Field(
|
|
41
|
-
title="Folder at the root of your project where artifacts necessary to perform the bundle step are stored.",
|
|
42
|
-
default="output/bundle/",
|
|
43
|
-
)
|
|
44
|
-
deploy_root: Optional[str] = Field(
|
|
45
|
-
title="Folder at the root of your project where the bundle step copies the artifacts.",
|
|
46
|
-
default="output/deploy/",
|
|
47
|
-
)
|
|
48
|
-
generated_root: Optional[str] = Field(
|
|
49
|
-
title="Subdirectory of the deploy root where files generated by the Snowflake CLI will be written.",
|
|
50
|
-
default="__generated/",
|
|
51
|
-
)
|
|
52
|
-
source_stage: Optional[str] = Field(
|
|
53
|
-
title="Identifier of the stage that stores the application artifacts.",
|
|
54
|
-
default="app_src.stage",
|
|
55
|
-
)
|
|
56
|
-
scratch_stage: Optional[str] = Field(
|
|
57
|
-
title="Identifier of the stage that stores temporary scratch data used by the Snowflake CLI.",
|
|
58
|
-
default="app_src.stage_snowflake_cli_scratch",
|
|
59
|
-
)
|
|
60
|
-
package: Optional[Package] = Field(title="PackageSchema", default=None)
|
|
61
|
-
application: Optional[Application] = Field(title="Application info", default=None)
|
|
62
|
-
|
|
63
|
-
@field_validator("source_stage")
|
|
64
|
-
@classmethod
|
|
65
|
-
def validate_source_stage(cls, input_value: str):
|
|
66
|
-
if not re.match(SCHEMA_AND_NAME, input_value):
|
|
67
|
-
raise ValueError("Incorrect value for source_stage value of native_app")
|
|
68
|
-
return input_value
|
|
69
|
-
|
|
70
|
-
@field_validator("artifacts")
|
|
71
|
-
@classmethod
|
|
72
|
-
def transform_artifacts(
|
|
73
|
-
cls, orig_artifacts: List[Union[PathMapping, str]]
|
|
74
|
-
) -> List[PathMapping]:
|
|
75
|
-
transformed_artifacts = []
|
|
76
|
-
if orig_artifacts is None:
|
|
77
|
-
return transformed_artifacts
|
|
78
|
-
|
|
79
|
-
for artifact in orig_artifacts:
|
|
80
|
-
if isinstance(artifact, PathMapping):
|
|
81
|
-
transformed_artifacts.append(artifact)
|
|
82
|
-
else:
|
|
83
|
-
transformed_artifacts.append(PathMapping(src=artifact))
|
|
84
|
-
|
|
85
|
-
return transformed_artifacts
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class NativeAppV11(NativeApp):
|
|
89
|
-
# templated defaults are only supported with version 1.1+
|
|
90
|
-
package: Optional[PackageV11] = Field(title="PackageSchema", default=PackageV11())
|
|
91
|
-
application: Optional[ApplicationV11] = Field(
|
|
92
|
-
title="Application info", default=ApplicationV11()
|
|
93
|
-
)
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import List, Literal, Optional
|
|
18
|
-
|
|
19
|
-
from pydantic import Field, field_validator, model_validator
|
|
20
|
-
from snowflake.cli.api.project.schemas.entities.common import PostDeployHook
|
|
21
|
-
from snowflake.cli.api.project.schemas.updatable_model import (
|
|
22
|
-
IdentifierField,
|
|
23
|
-
UpdatableModel,
|
|
24
|
-
)
|
|
25
|
-
from snowflake.cli.api.project.util import append_test_resource_suffix
|
|
26
|
-
|
|
27
|
-
DistributionOptions = Literal["internal", "external", "INTERNAL", "EXTERNAL"]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class Package(UpdatableModel):
|
|
31
|
-
scripts: Optional[List[str]] = Field(
|
|
32
|
-
title="List of SQL file paths relative to the project root", default=None
|
|
33
|
-
)
|
|
34
|
-
role: Optional[str] = IdentifierField(
|
|
35
|
-
title="Role to use when creating the application package and provider-side objects",
|
|
36
|
-
default=None,
|
|
37
|
-
)
|
|
38
|
-
name: Optional[str] = IdentifierField(
|
|
39
|
-
title="Name of the application package created when you run the snow app run command",
|
|
40
|
-
default=None,
|
|
41
|
-
)
|
|
42
|
-
warehouse: Optional[str] = IdentifierField(
|
|
43
|
-
title="Warehouse used to run the scripts", default=None
|
|
44
|
-
)
|
|
45
|
-
distribution: Optional[DistributionOptions] = Field(
|
|
46
|
-
title="Distribution of the application package created by the Snowflake CLI",
|
|
47
|
-
default="internal",
|
|
48
|
-
)
|
|
49
|
-
post_deploy: Optional[List[PostDeployHook]] = Field(
|
|
50
|
-
title="Actions that will be executed after the application package object is created/updated",
|
|
51
|
-
default=None,
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
@field_validator("name")
|
|
55
|
-
@classmethod
|
|
56
|
-
def append_test_resource_suffix_to_name(cls, input_value: str) -> str:
|
|
57
|
-
return append_test_resource_suffix(input_value)
|
|
58
|
-
|
|
59
|
-
@field_validator("scripts")
|
|
60
|
-
@classmethod
|
|
61
|
-
def validate_scripts(cls, input_list):
|
|
62
|
-
if len(input_list) != len(set(input_list)):
|
|
63
|
-
raise ValueError(
|
|
64
|
-
"package.scripts field should contain unique values. Check the list for duplicates and try again"
|
|
65
|
-
)
|
|
66
|
-
return input_list
|
|
67
|
-
|
|
68
|
-
@model_validator(mode="after")
|
|
69
|
-
@classmethod
|
|
70
|
-
def validate_no_scripts_and_post_deploy(cls, value: Package):
|
|
71
|
-
if value.scripts and value.post_deploy:
|
|
72
|
-
raise ValueError(
|
|
73
|
-
"package.scripts and package.post_deploy fields cannot be used together. "
|
|
74
|
-
"We recommend using package.post_deploy for all post package deploy scripts"
|
|
75
|
-
)
|
|
76
|
-
return value
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class PackageV11(Package):
|
|
80
|
-
# Templated defaults only supported in v1.1+
|
|
81
|
-
name: Optional[str] = IdentifierField(
|
|
82
|
-
title="Name of the application package created when you run the snow app run command",
|
|
83
|
-
default="<% fn.concat_ids(ctx.native_app.name, '_pkg_', fn.sanitize_id(fn.get_username('unknown_user')) | lower) %>",
|
|
84
|
-
)
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import Any, Dict, List, Optional, Union
|
|
18
|
-
|
|
19
|
-
from pydantic import Field, field_validator
|
|
20
|
-
from snowflake.cli.api.project.schemas.updatable_model import UpdatableModel
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class ProcessorMapping(UpdatableModel):
|
|
24
|
-
name: str = Field(
|
|
25
|
-
title="Name of a processor to invoke on a collection of artifacts."
|
|
26
|
-
)
|
|
27
|
-
properties: Optional[Dict[str, Any]] = Field(
|
|
28
|
-
title="A set of key-value pairs used to configure the output of the processor. Consult a specific processor's documentation for more details on the supported properties.",
|
|
29
|
-
default=None,
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class PathMapping(UpdatableModel):
|
|
34
|
-
src: str = Field(
|
|
35
|
-
title="Source path or glob pattern (relative to project root)", default=None
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
dest: Optional[str] = Field(
|
|
39
|
-
title="Destination path on stage",
|
|
40
|
-
description="Paths are relative to stage root; paths ending with a slash indicate that the destination is a directory which source files should be copied into.",
|
|
41
|
-
default=None,
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
processors: Optional[List[Union[str, ProcessorMapping]]] = Field(
|
|
45
|
-
title="List of processors to apply to matching source files during bundling.",
|
|
46
|
-
default=[],
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
@field_validator("processors")
|
|
50
|
-
@classmethod
|
|
51
|
-
def transform_processors(
|
|
52
|
-
cls, input_values: Optional[List[Union[str, Dict, ProcessorMapping]]]
|
|
53
|
-
) -> List[ProcessorMapping]:
|
|
54
|
-
if input_values is None:
|
|
55
|
-
return []
|
|
56
|
-
|
|
57
|
-
transformed_processors: List[ProcessorMapping] = []
|
|
58
|
-
for input_processor in input_values:
|
|
59
|
-
if isinstance(input_processor, str):
|
|
60
|
-
transformed_processors.append(ProcessorMapping(name=input_processor))
|
|
61
|
-
elif isinstance(input_processor, Dict):
|
|
62
|
-
transformed_processors.append(ProcessorMapping(**input_processor))
|
|
63
|
-
else:
|
|
64
|
-
transformed_processors.append(input_processor)
|
|
65
|
-
return transformed_processors
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import Optional
|
|
18
|
-
|
|
19
|
-
from pydantic import Field
|
|
20
|
-
from snowflake.cli.api.project.schemas.updatable_model import UpdatableModel
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class Argument(UpdatableModel):
|
|
24
|
-
name: str = Field(title="Name of the argument")
|
|
25
|
-
arg_type: str = Field(
|
|
26
|
-
title="Type of the argument", alias="type"
|
|
27
|
-
) # TODO: consider introducing literal/enum here
|
|
28
|
-
default: Optional[str] = Field(title="Default value for an argument", default=None)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import Dict, List, Optional, Union
|
|
18
|
-
|
|
19
|
-
from pydantic import Field, field_validator
|
|
20
|
-
from snowflake.cli.api.project.schemas.updatable_model import UpdatableModel
|
|
21
|
-
from snowflake.cli.api.project.schemas.v1.identifier_model import ObjectIdentifierModel
|
|
22
|
-
from snowflake.cli.api.project.schemas.v1.snowpark.argument import Argument
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class _CallableBase(UpdatableModel):
|
|
26
|
-
handler: str = Field(
|
|
27
|
-
title="Function’s or procedure’s implementation of the object inside source module",
|
|
28
|
-
examples=["functions.hello_function"],
|
|
29
|
-
)
|
|
30
|
-
returns: str = Field(
|
|
31
|
-
title="Type of the result"
|
|
32
|
-
) # TODO: again, consider Literal/Enum
|
|
33
|
-
signature: Union[str, List[Argument]] = Field(
|
|
34
|
-
title="The signature parameter describes consecutive arguments passed to the object"
|
|
35
|
-
)
|
|
36
|
-
runtime: Optional[Union[str, float]] = Field(
|
|
37
|
-
title="Python version to use when executing ", default=None
|
|
38
|
-
)
|
|
39
|
-
external_access_integrations: Optional[List[str]] = Field(
|
|
40
|
-
title="Names of external access integrations needed for this procedure’s handler code to access external networks",
|
|
41
|
-
default=[],
|
|
42
|
-
)
|
|
43
|
-
secrets: Optional[Dict[str, str]] = Field(
|
|
44
|
-
title="Assigns the names of secrets to variables so that you can use the variables to reference the secrets",
|
|
45
|
-
default={},
|
|
46
|
-
)
|
|
47
|
-
imports: Optional[List[str]] = Field(
|
|
48
|
-
title="Stage and path to previously uploaded files you want to import",
|
|
49
|
-
default=[],
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
@field_validator("runtime")
|
|
53
|
-
@classmethod
|
|
54
|
-
def convert_runtime(cls, runtime_input: Union[str, float]) -> str:
|
|
55
|
-
if isinstance(runtime_input, float):
|
|
56
|
-
return str(runtime_input)
|
|
57
|
-
return runtime_input
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class FunctionSchema(_CallableBase, ObjectIdentifierModel(object_name="function")): # type: ignore
|
|
61
|
-
pass
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class ProcedureSchema(_CallableBase, ObjectIdentifierModel(object_name="procedure")): # type: ignore
|
|
65
|
-
execute_as_caller: Optional[bool] = Field(
|
|
66
|
-
title="Determine whether the procedure is executed with the privileges of "
|
|
67
|
-
"the owner (you) or with the privileges of the caller",
|
|
68
|
-
default=False,
|
|
69
|
-
)
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import List, Optional
|
|
18
|
-
|
|
19
|
-
from pydantic import Field
|
|
20
|
-
from snowflake.cli.api.project.schemas.updatable_model import UpdatableModel
|
|
21
|
-
from snowflake.cli.api.project.schemas.v1.snowpark.callable import (
|
|
22
|
-
FunctionSchema,
|
|
23
|
-
ProcedureSchema,
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class Snowpark(UpdatableModel):
|
|
28
|
-
project_name: str = Field(title="Project identifier")
|
|
29
|
-
stage_name: str = Field(title="Stage in which project’s artifacts will be stored")
|
|
30
|
-
src: str = Field(title="Folder where your code should be located")
|
|
31
|
-
functions: Optional[List[FunctionSchema]] = Field(
|
|
32
|
-
title="List of functions defined in the project", default=[]
|
|
33
|
-
)
|
|
34
|
-
procedures: Optional[List[ProcedureSchema]] = Field(
|
|
35
|
-
title="List of procedures defined in the project", default=[]
|
|
36
|
-
)
|
|
File without changes
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Snowflake Inc.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from pathlib import Path
|
|
18
|
-
from typing import List, Optional
|
|
19
|
-
|
|
20
|
-
from pydantic import Field
|
|
21
|
-
from snowflake.cli.api.project.schemas.updatable_model import UpdatableModel
|
|
22
|
-
from snowflake.cli.api.project.schemas.v1.identifier_model import ObjectIdentifierModel
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class Streamlit(UpdatableModel, ObjectIdentifierModel(object_name="Streamlit")): # type: ignore
|
|
26
|
-
stage: Optional[str] = Field(
|
|
27
|
-
title="Stage in which the app’s artifacts will be stored", default="streamlit"
|
|
28
|
-
)
|
|
29
|
-
query_warehouse: str = Field(
|
|
30
|
-
title="Snowflake warehouse to host the app", default="streamlit"
|
|
31
|
-
)
|
|
32
|
-
main_file: Optional[Path] = Field(
|
|
33
|
-
title="Entrypoint file of the Streamlit app", default="streamlit_app.py"
|
|
34
|
-
)
|
|
35
|
-
env_file: Optional[Path] = Field(
|
|
36
|
-
title="File defining additional configurations for the app, such as external dependencies",
|
|
37
|
-
default=None,
|
|
38
|
-
)
|
|
39
|
-
pages_dir: Optional[Path] = Field(title="Streamlit pages", default=None)
|
|
40
|
-
additional_source_files: Optional[List[Path]] = Field(
|
|
41
|
-
title="List of additional files which should be included into deployment artifacts",
|
|
42
|
-
default=None,
|
|
43
|
-
)
|
|
44
|
-
title: Optional[str] = Field(
|
|
45
|
-
title="Human-readable title for the Streamlit dashboard", default=None
|
|
46
|
-
)
|
|
47
|
-
comment: Optional[str] = Field(title="Comment for the Streamlit app", default=None)
|