snowflake-cli-labs 3.0.0rc2__py3-none-any.whl → 3.0.0rc4__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/_app/commands_registration/builtin_plugins.py +2 -0
- snowflake/cli/_app/secret.py +9 -0
- snowflake/cli/_app/snow_connector.py +39 -27
- snowflake/cli/_app/telemetry.py +28 -0
- snowflake/cli/_plugins/connection/commands.py +9 -4
- snowflake/cli/_plugins/git/manager.py +53 -7
- snowflake/cli/_plugins/helpers/commands.py +61 -0
- snowflake/cli/{api/project/schemas/snowpark/__init__.py → _plugins/helpers/plugin_spec.py} +17 -0
- snowflake/cli/_plugins/nativeapp/artifacts.py +10 -9
- snowflake/cli/_plugins/nativeapp/bundle_context.py +1 -1
- snowflake/cli/_plugins/nativeapp/codegen/artifact_processor.py +1 -1
- snowflake/cli/_plugins/nativeapp/codegen/compiler.py +6 -1
- snowflake/cli/_plugins/nativeapp/codegen/setup/native_app_setup_processor.py +1 -1
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/extension_function_utils.py +1 -1
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/models.py +1 -1
- snowflake/cli/_plugins/nativeapp/codegen/snowpark/python_processor.py +5 -1
- snowflake/cli/_plugins/nativeapp/codegen/templates/templates_processor.py +4 -1
- snowflake/cli/_plugins/nativeapp/commands.py +87 -96
- snowflake/cli/_plugins/nativeapp/entities/__init__.py +0 -0
- snowflake/cli/{api/entities/application_entity.py → _plugins/nativeapp/entities/application.py} +264 -83
- snowflake/cli/_plugins/nativeapp/entities/application_package.py +1392 -0
- snowflake/cli/_plugins/nativeapp/exceptions.py +0 -9
- snowflake/cli/_plugins/nativeapp/manager.py +69 -185
- snowflake/cli/_plugins/nativeapp/policy.py +3 -0
- snowflake/cli/_plugins/nativeapp/project_model.py +2 -2
- snowflake/cli/_plugins/nativeapp/run_processor.py +17 -20
- snowflake/cli/_plugins/nativeapp/same_account_install_method.py +0 -4
- snowflake/cli/_plugins/nativeapp/teardown_processor.py +4 -6
- snowflake/cli/_plugins/nativeapp/v2_conversions/v2_to_v1_decorator.py +122 -88
- snowflake/cli/_plugins/nativeapp/version/commands.py +7 -39
- snowflake/cli/_plugins/nativeapp/version/version_processor.py +46 -312
- snowflake/cli/_plugins/object/manager.py +36 -15
- snowflake/cli/_plugins/snowpark/commands.py +4 -4
- snowflake/cli/_plugins/snowpark/common.py +4 -4
- snowflake/cli/{api/entities → _plugins/snowpark}/snowpark_entity.py +2 -2
- snowflake/cli/{api/project/schemas/entities/snowpark_entity.py → _plugins/snowpark/snowpark_entity_model.py} +3 -6
- snowflake/cli/_plugins/snowpark/snowpark_project_paths.py +1 -1
- snowflake/cli/_plugins/stage/manager.py +9 -4
- snowflake/cli/_plugins/streamlit/commands.py +15 -3
- snowflake/cli/_plugins/streamlit/manager.py +12 -4
- snowflake/cli/{api/entities → _plugins/streamlit}/streamlit_entity.py +2 -2
- snowflake/cli/{api/project/schemas/entities → _plugins/streamlit}/streamlit_entity_model.py +5 -12
- snowflake/cli/_plugins/workspace/commands.py +116 -36
- snowflake/cli/_plugins/workspace/plugin_spec.py +1 -1
- snowflake/cli/api/cli_global_context.py +7 -0
- snowflake/cli/api/commands/decorators.py +14 -0
- snowflake/cli/api/commands/flags.py +18 -0
- snowflake/cli/api/commands/snow_typer.py +1 -1
- snowflake/cli/api/config.py +25 -6
- snowflake/cli/api/connections.py +3 -1
- snowflake/cli/api/entities/common.py +4 -0
- snowflake/cli/api/entities/utils.py +3 -14
- snowflake/cli/api/errno.py +1 -0
- snowflake/cli/api/identifiers.py +4 -3
- snowflake/cli/api/metrics.py +92 -0
- snowflake/cli/api/project/definition_conversion.py +61 -18
- snowflake/cli/api/project/schemas/entities/common.py +17 -4
- snowflake/cli/api/project/schemas/entities/entities.py +11 -10
- snowflake/cli/api/project/schemas/project_definition.py +5 -7
- snowflake/cli/api/project/schemas/v1/__init__.py +0 -0
- snowflake/cli/api/project/schemas/{identifier_model.py → v1/identifier_model.py} +0 -7
- snowflake/cli/api/project/schemas/v1/native_app/__init__.py +0 -0
- snowflake/cli/api/project/schemas/{native_app → v1/native_app}/native_app.py +4 -4
- snowflake/cli/api/project/schemas/v1/snowpark/__init__.py +0 -0
- snowflake/cli/api/project/schemas/{snowpark → v1/snowpark}/callable.py +2 -2
- snowflake/cli/api/project/schemas/{snowpark → v1/snowpark}/snowpark.py +2 -2
- snowflake/cli/api/project/schemas/v1/streamlit/__init__.py +0 -0
- snowflake/cli/api/project/schemas/{streamlit → v1/streamlit}/streamlit.py +2 -1
- snowflake/cli/api/rendering/sql_templates.py +6 -0
- snowflake/cli/api/rest_api.py +11 -5
- snowflake/cli/api/sql_execution.py +6 -15
- snowflake/cli/api/utils/definition_rendering.py +24 -4
- {snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/METADATA +9 -7
- {snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/RECORD +83 -79
- snowflake/cli/_plugins/nativeapp/init.py +0 -345
- snowflake/cli/api/entities/application_package_entity.py +0 -658
- snowflake/cli/api/project/schemas/entities/application_entity_model.py +0 -56
- snowflake/cli/api/project/schemas/entities/application_package_entity_model.py +0 -94
- snowflake/cli/api/project/schemas/streamlit/__init__.py +0 -13
- /snowflake/cli/{api/project/schemas/native_app → _plugins/helpers}/__init__.py +0 -0
- /snowflake/cli/api/project/schemas/{native_app → v1/native_app}/application.py +0 -0
- /snowflake/cli/api/project/schemas/{native_app → v1/native_app}/package.py +0 -0
- /snowflake/cli/api/project/schemas/{native_app → v1/native_app}/path_mapping.py +0 -0
- /snowflake/cli/api/project/schemas/{snowpark → v1/snowpark}/argument.py +0 -0
- {snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/WHEEL +0 -0
- {snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/entry_points.txt +0 -0
- {snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,56 +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 Literal, Optional
|
|
18
|
-
|
|
19
|
-
from pydantic import Field, field_validator
|
|
20
|
-
from snowflake.cli.api.project.schemas.entities.application_package_entity_model import (
|
|
21
|
-
ApplicationPackageEntityModel,
|
|
22
|
-
)
|
|
23
|
-
from snowflake.cli.api.project.schemas.entities.common import (
|
|
24
|
-
EntityModelBase,
|
|
25
|
-
TargetField,
|
|
26
|
-
)
|
|
27
|
-
from snowflake.cli.api.project.schemas.identifier_model import Identifier
|
|
28
|
-
from snowflake.cli.api.project.schemas.updatable_model import (
|
|
29
|
-
DiscriminatorField,
|
|
30
|
-
)
|
|
31
|
-
from snowflake.cli.api.project.util import append_test_resource_suffix
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class ApplicationEntityModel(EntityModelBase):
|
|
35
|
-
type: Literal["application"] = DiscriminatorField() # noqa A003
|
|
36
|
-
from_: TargetField[ApplicationPackageEntityModel] = Field(
|
|
37
|
-
alias="from",
|
|
38
|
-
title="An application package this entity should be created from",
|
|
39
|
-
)
|
|
40
|
-
debug: Optional[bool] = Field(
|
|
41
|
-
title="Whether to enable debug mode when using a named stage to create an application object",
|
|
42
|
-
default=None,
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
@field_validator("identifier")
|
|
46
|
-
@classmethod
|
|
47
|
-
def append_test_resource_suffix_to_identifier(
|
|
48
|
-
cls, input_value: Identifier | str
|
|
49
|
-
) -> Identifier | str:
|
|
50
|
-
identifier = (
|
|
51
|
-
input_value.name if isinstance(input_value, Identifier) else input_value
|
|
52
|
-
)
|
|
53
|
-
with_suffix = append_test_resource_suffix(identifier)
|
|
54
|
-
if isinstance(input_value, Identifier):
|
|
55
|
-
return input_value.model_copy(update=dict(name=with_suffix))
|
|
56
|
-
return with_suffix
|
|
@@ -1,94 +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, Union
|
|
18
|
-
|
|
19
|
-
from pydantic import Field, field_validator
|
|
20
|
-
from snowflake.cli.api.project.schemas.entities.common import (
|
|
21
|
-
EntityModelBase,
|
|
22
|
-
)
|
|
23
|
-
from snowflake.cli.api.project.schemas.identifier_model import Identifier
|
|
24
|
-
from snowflake.cli.api.project.schemas.native_app.package import DistributionOptions
|
|
25
|
-
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
|
|
26
|
-
from snowflake.cli.api.project.schemas.updatable_model import (
|
|
27
|
-
DiscriminatorField,
|
|
28
|
-
IdentifierField,
|
|
29
|
-
)
|
|
30
|
-
from snowflake.cli.api.project.util import append_test_resource_suffix
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class ApplicationPackageEntityModel(EntityModelBase):
|
|
34
|
-
type: Literal["application package"] = DiscriminatorField() # noqa: A003
|
|
35
|
-
artifacts: List[Union[PathMapping, str]] = Field(
|
|
36
|
-
title="List of paths or file source/destination pairs to add to the deploy root",
|
|
37
|
-
)
|
|
38
|
-
bundle_root: Optional[str] = Field(
|
|
39
|
-
title="Folder at the root of your project where artifacts necessary to perform the bundle step are stored.",
|
|
40
|
-
default="output/bundle/",
|
|
41
|
-
)
|
|
42
|
-
deploy_root: Optional[str] = Field(
|
|
43
|
-
title="Folder at the root of your project where the build step copies the artifacts",
|
|
44
|
-
default="output/deploy/",
|
|
45
|
-
)
|
|
46
|
-
generated_root: Optional[str] = Field(
|
|
47
|
-
title="Subdirectory of the deploy root where files generated by the Snowflake CLI will be written.",
|
|
48
|
-
default="__generated/",
|
|
49
|
-
)
|
|
50
|
-
stage: Optional[str] = IdentifierField(
|
|
51
|
-
title="Identifier of the stage that stores the application artifacts.",
|
|
52
|
-
default="app_src.stage",
|
|
53
|
-
)
|
|
54
|
-
scratch_stage: Optional[str] = IdentifierField(
|
|
55
|
-
title="Identifier of the stage that stores temporary scratch data used by the Snowflake CLI.",
|
|
56
|
-
default="app_src.stage_snowflake_cli_scratch",
|
|
57
|
-
)
|
|
58
|
-
distribution: Optional[DistributionOptions] = Field(
|
|
59
|
-
title="Distribution of the application package created by the Snowflake CLI",
|
|
60
|
-
default="internal",
|
|
61
|
-
)
|
|
62
|
-
manifest: str = Field(
|
|
63
|
-
title="Path to manifest.yml",
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
@field_validator("identifier")
|
|
67
|
-
@classmethod
|
|
68
|
-
def append_test_resource_suffix_to_identifier(
|
|
69
|
-
cls, input_value: Identifier | str
|
|
70
|
-
) -> Identifier | str:
|
|
71
|
-
identifier = (
|
|
72
|
-
input_value.name if isinstance(input_value, Identifier) else input_value
|
|
73
|
-
)
|
|
74
|
-
with_suffix = append_test_resource_suffix(identifier)
|
|
75
|
-
if isinstance(input_value, Identifier):
|
|
76
|
-
return input_value.model_copy(update=dict(name=with_suffix))
|
|
77
|
-
return with_suffix
|
|
78
|
-
|
|
79
|
-
@field_validator("artifacts")
|
|
80
|
-
@classmethod
|
|
81
|
-
def transform_artifacts(
|
|
82
|
-
cls, orig_artifacts: List[Union[PathMapping, str]]
|
|
83
|
-
) -> List[PathMapping]:
|
|
84
|
-
transformed_artifacts = []
|
|
85
|
-
if orig_artifacts is None:
|
|
86
|
-
return transformed_artifacts
|
|
87
|
-
|
|
88
|
-
for artifact in orig_artifacts:
|
|
89
|
-
if isinstance(artifact, PathMapping):
|
|
90
|
-
transformed_artifacts.append(artifact)
|
|
91
|
-
else:
|
|
92
|
-
transformed_artifacts.append(PathMapping(src=artifact))
|
|
93
|
-
|
|
94
|
-
return transformed_artifacts
|
|
@@ -1,13 +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.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{snowflake_cli_labs-3.0.0rc2.dist-info → snowflake_cli_labs-3.0.0rc4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|