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

Use official release of snowflake connector #283

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ dependencies = [
"rich==13.5.1",
"requests==2.31.0",
"requirements-parser==0.5.0",
# "snowflake-connector-python==3.0.4",
"snowflake-connector-python-nightly[secure-local-storage]==2023.6.24",
"snowflake-connector-python[secure-local-storage]==3.1.0",
"tomlkit==0.12.1",
"urllib3<1.27,>=1.21.1",
"typer==0.9.0",
"urllib3<1.27,>=1.21.1",
]
classifiers = [
"Development Status :: 3 - Alpha",
Expand Down
5 changes: 3 additions & 2 deletions src/snowcli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Optional, Any, Dict, Union

import tomlkit
from snowflake.connector.errors import MissingConfigOptionError
from tomlkit import dump, table, TOMLDocument
from tomlkit.exceptions import NonExistentKey
from tomlkit.items import Table
Expand Down Expand Up @@ -44,7 +45,7 @@ def section_exists(self, *path) -> bool:
try:
self._find_section(*path)
return True
except NonExistentKey:
except (NonExistentKey, MissingConfigOptionError):
return False

def get(self, *path, key: str, default: Optional[Any] = None) -> Any:
Expand All @@ -54,7 +55,7 @@ def get(self, *path, key: str, default: Optional[Any] = None) -> Any:
return env_variable
try:
return self.get_section(*path)[key]
except NonExistentKey:
except (NonExistentKey, MissingConfigOptionError):
if default:
return default
raise
Expand Down