Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/coverage-7.6.10
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-turbaszek authored Jan 8, 2025
2 parents 69aa890 + 21d864a commit 777504d
Show file tree
Hide file tree
Showing 10 changed files with 659 additions and 422 deletions.
26 changes: 24 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,35 @@
* Add ability to list release channels through `snow app release-channel list` command
* Add ability to add and remove accounts from release channels through `snow app release-channel add-accounts` and snow app release-channel remove-accounts` commands.
* Add ability to add/remove versions to/from release channels through `snow app release-channel add-version` and `snow app release-channel remove-version` commands.

* Add support for restricting Snowflake user authentication policy to Snowflake CLI-only.
## Fixes and improvements
* Fixed crashes with older x86_64 Intel CPUs.
* Fixed inability to add patches to lowercase quoted versions
* Fixes label being set to blank instead of None when not provided.
* Added a feature flag `ENABLE_SPCS_LOG_STREAMING` to control the rollout of the log streaming feature


# v3.2.2
## Backward incompatibility

## Deprecations

## New additions

## Fixes and improvements
* Fix "No module named 'pandas'" warning.


# v3.2.1
## Backward incompatibility

## Deprecations

## New additions

## Fixes and improvements
* Fixed crashes with older x86_64 Intel CPUs.


# v3.2.0

## Deprecations
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ requires-python = ">=3.10"
description = "Snowflake CLI"
readme = "README.md"
dependencies = [
"click==8.1.7",
"jinja2==3.1.4",
"pluggy==1.5.0",
"PyYAML==6.0.2",
Expand Down
1 change: 1 addition & 0 deletions snyk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
click==8.1.7
jinja2==3.1.4
pluggy==1.5.0
PyYAML==6.0.2
Expand Down
4 changes: 4 additions & 0 deletions src/snowflake/cli/_app/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
from typing import Literal

PARAM_APPLICATION_NAME: Literal["snowcli"] = "snowcli"

# This is also defined on server side. Changing this parameter would require
# a change in https://github.com/snowflakedb/snowflake
INTERNAL_APPLICATION_NAME: Literal["SNOWFLAKE_CLI"] = "SNOWFLAKE_CLI"
12 changes: 12 additions & 0 deletions src/snowflake/cli/_app/snow_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

import snowflake.connector
from click.exceptions import ClickException
from snowflake.cli.__about__ import VERSION
from snowflake.cli._app.constants import (
INTERNAL_APPLICATION_NAME,
PARAM_APPLICATION_NAME,
)
from snowflake.cli._app.secret import SecretType
Expand All @@ -35,6 +37,7 @@
InvalidConnectionConfiguration,
SnowflakeConnectionError,
)
from snowflake.cli.api.feature_flags import FeatureFlag
from snowflake.cli.api.secure_path import SecurePath
from snowflake.connector import SnowflakeConnection
from snowflake.connector.errors import DatabaseError, ForbiddenError
Expand Down Expand Up @@ -150,6 +153,8 @@ def connect_to_snowflake(

_update_connection_application_name(connection_parameters)

_update_internal_application_info(connection_parameters)

try:
# Whatever output is generated when creating connection,
# we don't want it in our output. This is particularly important
Expand Down Expand Up @@ -238,6 +243,13 @@ def _update_connection_application_name(connection_parameters: Dict):
connection_parameters.update(connection_application_params)


def _update_internal_application_info(connection_parameters: Dict):
"""Update internal application data if ENABLE_SEPARATE_AUTHENTICATION_POLICY_ID is enabled."""
if FeatureFlag.ENABLE_SEPARATE_AUTHENTICATION_POLICY_ID.is_enabled():
connection_parameters["internal_application_name"] = INTERNAL_APPLICATION_NAME
connection_parameters["internal_application_version"] = VERSION


def _load_pem_from_file(private_key_file: str) -> SecretType:
with SecurePath(private_key_file).open(
"rb", read_file_limit_mb=DEFAULT_SIZE_LIMIT_MB
Expand Down
Loading

0 comments on commit 777504d

Please sign in to comment.