Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.1.1 cp #902

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/snowflake/cli/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

VERSION = "2.1.0"
VERSION = "2.1.1"
4 changes: 2 additions & 2 deletions src/snowflake/cli/plugins/nativeapp/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from pathlib import Path
from typing import List, Optional, Tuple, Union

import strictyaml
from click import ClickException
from snowflake.cli.api.constants import DEFAULT_SIZE_LIMIT_MB
from snowflake.cli.api.secure_path import SecurePath
from yaml import safe_load


class DeployRootError(ClickException):
Expand Down Expand Up @@ -270,7 +270,7 @@ def find_version_info_in_manifest_file(
with SecurePath(manifest_file).open(
"r", read_file_limit_mb=DEFAULT_SIZE_LIMIT_MB
) as file:
manifest_content = strictyaml.load(file.read())
manifest_content = safe_load(file.read())

version_name: Optional[str] = None
patch_name: Optional[str] = None
Expand Down
16 changes: 9 additions & 7 deletions src/snowflake/cli/plugins/nativeapp/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
)
from snowflake.cli.api.secure_path import SecurePath
from snowflake.cli.api.utils.rendering import generic_render_template
from strictyaml import as_document, load
from yaml import dump
from yaml import dump, safe_dump, safe_load

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -154,17 +153,20 @@ def _replace_snowflake_yml_name_with_project(
path_to_snowflake_yml = SecurePath(target_directory) / "snowflake.yml"
contents = None

with path_to_snowflake_yml.open("r", read_file_limit_mb=DEFAULT_SIZE_LIMIT_MB) as f:
contents = load(f.read()).data
with path_to_snowflake_yml.open(
"r", read_file_limit_mb=DEFAULT_SIZE_LIMIT_MB
) as file:
contents = safe_load(file)

if (
("native_app" in contents)
(contents is not None)
and ("native_app" in contents)
and ("name" in contents["native_app"])
and (contents["native_app"]["name"] != project_identifier)
):
contents["native_app"]["name"] = project_identifier
with path_to_snowflake_yml.open("w") as f:
f.write(as_document(contents).as_yaml())
with path_to_snowflake_yml.open("w") as file:
safe_dump(contents, file, sort_keys=False)


def _validate_and_update_snowflake_yml(target_directory: Path, project_identifier: str):
Expand Down
Loading