Skip to content

Commit

Permalink
fix: fix missing database reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Zane Clark committed Oct 31, 2024
1 parent 19319b6 commit e82b3b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions schemachange/config/DeployConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,4 @@ def get_session_kwargs(self) -> dict:
"autocommit": self.autocommit,
"query_tag": self.query_tag,
}
print("get_session_kwargs")
print(session_kwargs)
return {k: v for k, v in session_kwargs.items() if v is not None}
10 changes: 5 additions & 5 deletions schemachange/config/get_merged_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def get_merged_config(
logger: structlog.BoundLogger,
) -> Union[DeployConfig, RenderConfig]:
env_kwargs: dict[str, str] = get_env_kwargs()
logger.info("env_kwargs", **env_kwargs)
logger.debug("env_kwargs", **env_kwargs)

connection_name = env_kwargs.pop("connection_name", None)

cli_kwargs = parse_cli_args(sys.argv[1:])
logger.info("cli_kwargs", **cli_kwargs)
logger.debug("cli_kwargs", **cli_kwargs)

cli_config_vars = cli_kwargs.pop("config_vars")

Expand All @@ -65,7 +65,7 @@ def get_merged_config(
yaml_kwargs = get_yaml_config_kwargs(
config_file_path=config_file_path,
)
logger.info("yaml_kwargs", **yaml_kwargs)
logger.debug("yaml_kwargs", **yaml_kwargs)

yaml_config_vars = yaml_kwargs.pop("config_vars", None)
if yaml_config_vars is None:
Expand All @@ -86,7 +86,7 @@ def get_merged_config(
connections_file_path=connections_file_path,
connection_name=connection_name,
)
logger.info("connection_kwargs", **connection_kwargs)
logger.debug("connection_kwargs", **connection_kwargs)

config_vars = {
**yaml_config_vars,
Expand All @@ -107,7 +107,7 @@ def get_merged_config(
if connection_name is not None:
kwargs["connection_name"] = connection_name

logger.info("final kwargs", **kwargs)
logger.debug("final kwargs", **kwargs)

if cli_kwargs["subcommand"] == "deploy":
return DeployConfig.factory(**kwargs)
Expand Down
6 changes: 3 additions & 3 deletions schemachange/session/SnowflakeSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __init__(
connect_kwargs = {
"account": self.account,
"user": self.user,
"database": kwargs.get("database"),
"schema": kwargs.get("schema"),
"database": self.database,
"schema": self.schema,
"role": self.role,
"warehouse": self.warehouse,
"private_key_file": kwargs.get("private_key_path"),
Expand All @@ -75,7 +75,7 @@ def __init__(
"application": application,
"session_parameters": self.session_parameters,
}
self.logger.info("snowflake.connector.connect kwargs", **connect_kwargs)
self.logger.debug("snowflake.connector.connect kwargs", **connect_kwargs)
self.con = snowflake.connector.connect(**connect_kwargs)
print(f"Current session ID: {self.con.session_id}")

Expand Down

0 comments on commit e82b3b9

Please sign in to comment.