Skip to content

Commit

Permalink
Merge branch 'main' into vmaleki-add-comment-support
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-vmaleki committed Sep 18, 2024
2 parents eb9e60b + b87e39c commit 72a0890
Show file tree
Hide file tree
Showing 76 changed files with 384 additions and 394 deletions.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ dependencies = [
"pluggy==1.5.0",
"PyYAML==6.0.2",
"packaging",
"rich==13.8.0",
"rich==13.8.1",
"requests==2.32.3",
"requirements-parser==0.11.0",
"setuptools==74.1.2",
'snowflake.core==0.8.0; python_version < "3.12"',
"snowflake-connector-python[secure-local-storage]==3.12.1",
"setuptools==75.1.0",
'snowflake.core==0.12.1; python_version < "3.12"',
"snowflake-connector-python[secure-local-storage]==3.12.2",
'snowflake-snowpark-python>=1.15.0;python_version < "3.12"',
"tomlkit==0.13.2",
"typer==0.12.5",
Expand All @@ -59,7 +59,7 @@ classifiers = [
development = [
"coverage==7.6.1",
"pre-commit>=3.5.0",
"pytest==8.3.2",
"pytest==8.3.3",
"pytest-randomly==3.15.0",
"syrupy==4.7.1",
]
Expand Down
10 changes: 5 additions & 5 deletions snyk/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ jinja2==3.1.4
pluggy==1.5.0
PyYAML==6.0.2
packaging
rich==13.8.0
rich==13.8.1
requests==2.32.3
requirements-parser==0.11.0
setuptools==74.1.2
snowflake.core==0.8.0; python_version < "3.12"
snowflake-connector-python[secure-local-storage]==3.12.1
setuptools==75.1.0
snowflake.core==0.12.1; python_version < "3.12"
snowflake-connector-python[secure-local-storage]==3.12.2
snowflake-snowpark-python>=1.15.0;python_version < "3.12"
tomlkit==0.13.2
typer==0.12.5
Expand All @@ -17,6 +17,6 @@ pip
pydantic==2.9.1
coverage==7.6.1
pre-commit>=3.5.0
pytest==8.3.2
pytest==8.3.3
pytest-randomly==3.15.0
syrupy==4.7.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@

import typer
from click import ClickException, UsageError
from snowflake.cli._plugins.nativeapp.application_entity_model import (
ApplicationEntityModel,
)
from snowflake.cli._plugins.nativeapp.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli._plugins.nativeapp.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli._plugins.nativeapp.common_flags import (
ForceOption,
InteractiveOption,
Expand Down Expand Up @@ -36,9 +45,6 @@
)
from snowflake.cli._plugins.workspace.action_context import ActionContext
from snowflake.cli.api.console.abc import AbstractConsole
from snowflake.cli.api.entities.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli.api.entities.common import EntityBase, get_sql_executor
from snowflake.cli.api.entities.utils import (
drop_generic_object,
Expand All @@ -55,12 +61,6 @@
ONLY_SUPPORTED_ON_DEV_MODE_APPLICATIONS,
)
from snowflake.cli.api.exceptions import SnowflakeSQLExecutionError
from snowflake.cli.api.project.schemas.entities.application_entity_model import (
ApplicationEntityModel,
)
from snowflake.cli.api.project.schemas.entities.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli.api.project.schemas.entities.common import PostDeployHook
from snowflake.cli.api.project.util import (
extract_schema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
from typing import Literal, Optional

from pydantic import Field, field_validator
from snowflake.cli.api.project.schemas.entities.application_package_entity_model import (
from snowflake.cli._plugins.nativeapp.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli.api.project.schemas.entities.common import (
EntityModelBase,
Identifier,
TargetField,
)
from snowflake.cli.api.project.schemas.identifier_model import Identifier
from snowflake.cli.api.project.schemas.updatable_model import (
DiscriminatorField,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

import typer
from click import ClickException
from snowflake.cli._plugins.nativeapp.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli._plugins.nativeapp.artifacts import build_bundle
from snowflake.cli._plugins.nativeapp.bundle_context import BundleContext
from snowflake.cli._plugins.nativeapp.codegen.compiler import NativeAppCompiler
Expand Down Expand Up @@ -45,11 +48,8 @@
DOES_NOT_EXIST_OR_NOT_AUTHORIZED,
)
from snowflake.cli.api.exceptions import SnowflakeSQLExecutionError
from snowflake.cli.api.project.schemas.entities.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli.api.project.schemas.entities.common import PostDeployHook
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.util import extract_schema
from snowflake.cli.api.rendering.jinja import (
get_basic_jinja_env,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
from pydantic import Field, field_validator
from snowflake.cli.api.project.schemas.entities.common import (
EntityModelBase,
Identifier,
)
from snowflake.cli.api.project.schemas.identifier_model import Identifier
from snowflake.cli.api.project.schemas.native_app.package import DistributionOptions
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.updatable_model import (
DiscriminatorField,
IdentifierField,
)
from snowflake.cli.api.project.schemas.v1.native_app.package import DistributionOptions
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.util import append_test_resource_suffix


Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/cli/_plugins/nativeapp/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from click.exceptions import ClickException
from snowflake.cli.api.constants import DEFAULT_SIZE_LIMIT_MB
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
from snowflake.cli.api.secure_path import SecurePath
from yaml import safe_load

Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/cli/_plugins/nativeapp/bundle_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
List,
)

from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from click import ClickException
from snowflake.cli._plugins.nativeapp.bundle_context import BundleContext
from snowflake.cli.api.project.schemas.native_app.path_mapping import (
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import (
PathMapping,
ProcessorMapping,
)
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/cli/_plugins/nativeapp/codegen/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from snowflake.cli._plugins.nativeapp.feature_flags import FeatureFlag
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.project.schemas.native_app.path_mapping import (
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import (
ProcessorMapping,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
)
from snowflake.cli._plugins.stage.diff import to_stage_path
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.project.schemas.native_app.path_mapping import (
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import (
PathMapping,
ProcessorMapping,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ExtensionFunctionTypeEnum,
NativeAppExtensionFunction,
)
from snowflake.cli.api.project.schemas.snowpark.argument import Argument
from snowflake.cli.api.project.schemas.v1.snowpark.argument import Argument
from snowflake.cli.api.project.util import (
is_valid_identifier,
is_valid_string_literal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from typing import List, Optional

from pydantic import Field
from snowflake.cli.api.project.schemas.snowpark.callable import _CallableBase
from snowflake.cli.api.project.schemas.updatable_model import IdentifierField
from snowflake.cli.api.project.schemas.v1.snowpark.callable import _CallableBase


class ExtensionFunctionTypeEnum(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
)
from snowflake.cli._plugins.stage.diff import to_stage_path
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.project.schemas.native_app.path_mapping import (
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import (
PathMapping,
ProcessorMapping,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from snowflake.cli._plugins.nativeapp.exceptions import InvalidTemplateInFileError
from snowflake.cli.api.cli_global_context import get_cli_context
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.project.schemas.native_app.path_mapping import (
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import (
PathMapping,
ProcessorMapping,
)
Expand Down
18 changes: 9 additions & 9 deletions src/snowflake/cli/_plugins/nativeapp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
from typing import Generator, List, Optional

from snowflake.cli._plugins.connection.util import make_snowsight_url
from snowflake.cli._plugins.nativeapp.application_entity import (
ApplicationEntity,
ApplicationOwnedObject,
)
from snowflake.cli._plugins.nativeapp.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli._plugins.nativeapp.artifacts import (
BundleMap,
)
Expand All @@ -36,21 +43,14 @@
DiffResult,
)
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.entities.application_entity import (
ApplicationEntity,
ApplicationOwnedObject,
)
from snowflake.cli.api.entities.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli.api.entities.utils import (
execute_post_deploy_hooks,
generic_sql_error_handler,
sync_deploy_root_with_stage,
)
from snowflake.cli.api.project.schemas.entities.common import PostDeployHook
from snowflake.cli.api.project.schemas.native_app.native_app import NativeApp
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.v1.native_app.native_app import NativeApp
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.util import (
identifier_for_url,
unquote_identifier,
Expand Down
4 changes: 2 additions & 2 deletions src/snowflake/cli/_plugins/nativeapp/project_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
default_role,
)
from snowflake.cli.api.project.schemas.entities.common import PostDeployHook
from snowflake.cli.api.project.schemas.native_app.native_app import NativeApp
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.v1.native_app.native_app import NativeApp
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.util import (
append_test_resource_suffix,
extract_schema,
Expand Down
14 changes: 7 additions & 7 deletions src/snowflake/cli/_plugins/nativeapp/run_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
from typing import Optional

import typer
from snowflake.cli._plugins.nativeapp.application_entity import (
ApplicationEntity,
)
from snowflake.cli._plugins.nativeapp.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli._plugins.nativeapp.artifacts import BundleMap
from snowflake.cli._plugins.nativeapp.manager import (
NativeAppCommandProcessor,
Expand All @@ -28,20 +34,14 @@
SameAccountInstallMethod,
)
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.entities.application_entity import (
ApplicationEntity,
)
from snowflake.cli.api.entities.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli.api.entities.utils import (
generic_sql_error_handler,
)
from snowflake.cli.api.errno import (
APPLICATION_NO_LONGER_AVAILABLE,
APPLICATION_OWNS_EXTERNAL_OBJECTS,
)
from snowflake.cli.api.project.schemas.native_app.native_app import NativeApp
from snowflake.cli.api.project.schemas.v1.native_app.native_app import NativeApp
from snowflake.connector import ProgrammingError
from snowflake.connector.cursor import SnowflakeCursor

Expand Down
12 changes: 6 additions & 6 deletions src/snowflake/cli/_plugins/nativeapp/teardown_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
from pathlib import Path
from typing import Dict, Optional

from snowflake.cli._plugins.nativeapp.application_entity import (
ApplicationEntity,
)
from snowflake.cli._plugins.nativeapp.application_package_entity import (
ApplicationPackageEntity,
)
from snowflake.cli._plugins.nativeapp.manager import (
NativeAppCommandProcessor,
NativeAppManager,
)
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.entities.application_entity import (
ApplicationEntity,
)
from snowflake.cli.api.entities.application_package_entity import (
ApplicationPackageEntity,
)


class NativeAppTeardownProcessor(NativeAppManager, NativeAppCommandProcessor):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@

import typer
from click import ClickException
from snowflake.cli._plugins.nativeapp.application_entity_model import (
ApplicationEntityModel,
)
from snowflake.cli._plugins.nativeapp.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli.api.cli_global_context import (
get_cli_context,
get_cli_context_manager,
)
from snowflake.cli.api.commands.decorators import _options_decorator_factory
from snowflake.cli.api.project.schemas.entities.application_entity_model import (
ApplicationEntityModel,
)
from snowflake.cli.api.project.schemas.entities.application_package_entity_model import (
ApplicationPackageEntityModel,
)
from snowflake.cli.api.project.schemas.native_app.path_mapping import PathMapping
from snowflake.cli.api.project.schemas.project_definition import (
DefinitionV11,
DefinitionV20,
)
from snowflake.cli.api.project.schemas.v1.native_app.path_mapping import PathMapping
from snowflake.cli.api.utils.definition_rendering import render_definition_template


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from snowflake.cli.api.console import cli_console as cc
from snowflake.cli.api.entities.utils import ensure_correct_owner
from snowflake.cli.api.exceptions import SnowflakeSQLExecutionError
from snowflake.cli.api.project.schemas.native_app.native_app import NativeApp
from snowflake.cli.api.project.schemas.v1.native_app.native_app import NativeApp
from snowflake.cli.api.project.util import to_identifier, unquote_identifier
from snowflake.cli.api.utils.cursor import (
find_all_rows,
Expand Down
8 changes: 4 additions & 4 deletions src/snowflake/cli/_plugins/snowpark/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
AnacondaPackagesManager,
)
from snowflake.cli._plugins.snowpark.package.commands import app as package_app
from snowflake.cli._plugins.snowpark.snowpark_entity_model import (
FunctionEntityModel,
ProcedureEntityModel,
)
from snowflake.cli._plugins.snowpark.snowpark_project_paths import (
SnowparkProjectPaths,
)
Expand Down Expand Up @@ -87,10 +91,6 @@
from snowflake.cli.api.project.definition_conversion import (
convert_project_definition_to_v2,
)
from snowflake.cli.api.project.schemas.entities.snowpark_entity import (
FunctionEntityModel,
ProcedureEntityModel,
)
from snowflake.cli.api.project.schemas.project_definition import (
ProjectDefinition,
ProjectDefinitionV2,
Expand Down
Loading

0 comments on commit 72a0890

Please sign in to comment.