Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jsikorski committed Mar 7, 2024
1 parent e0db3fd commit bea3edc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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,7 +3,7 @@
from pathlib import Path
from typing import List, Optional, Tuple, Union

import strictyaml
import yaml
from click import ClickException
from snowflake.cli.api.constants import DEFAULT_SIZE_LIMIT_MB
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
Expand Down Expand Up @@ -271,7 +271,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 = yaml.load(file.read(), Loader=yaml.BaseLoader)

version_name: Optional[str] = None
patch_name: Optional[str] = None
Expand Down
10 changes: 6 additions & 4 deletions tests_integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from typing import Any, Dict, List, Optional

import pytest
import strictyaml
import yaml

from snowflake.cli.api.cli_global_context import cli_context_manager
from snowflake.cli.api.project.definition import merge_left
from snowflake.cli.app.cli_app import app_factory
from strictyaml import as_document
from typer import Typer
from typer.testing import CliRunner

Expand Down Expand Up @@ -131,10 +131,12 @@ def _temporary_project_directory(
test_data_file = test_root_path / "test_data" / "projects" / project_name
shutil.copytree(test_data_file, temporary_working_directory, dirs_exist_ok=True)
if merge_project_definition:
project_definition = strictyaml.load(Path("snowflake.yml").read_text()).data
project_definition = yaml.load(
Path("snowflake.yml").read_text(), Loader=yaml.BaseLoader
)
merge_left(project_definition, merge_project_definition)
with open(Path(temporary_working_directory) / "snowflake.yml", "w") as file:
file.write(as_document(project_definition).as_yaml())
file.write(yaml.dump(project_definition))

yield temporary_working_directory

Expand Down

0 comments on commit bea3edc

Please sign in to comment.