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

Revert commits #443

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add AWS_REGION to storage_options (#3)
  • Loading branch information
chidifrank authored Sep 6, 2024
commit b0cb467da48e34931b7fd4eb61668171eaf82cd8
9 changes: 9 additions & 0 deletions dbt/adapters/duckdb/plugins/unity.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ class Plugin(BasePlugin):
# The Unitycatalog client
uc_client: Unitycatalog

# The AWS region
aws_region: str

def initialize(self, config: Dict[str, Any]):
# Assert that the credentials and secrets are present
assert self.creds is not None, "Credentials are required for the plugin!"
Expand All @@ -228,6 +231,9 @@ def initialize(self, config: Dict[str, Any]):
# Find the UC secret
uc_secret = find_secrets_by_type(self.creds.secrets, "UC")

# Get AWS region from the UC secret
self.aws_region = uc_secret["aws_region"]

# Get the endpoint from the UC secret
host_and_port = uc_secret["endpoint"]

Expand Down Expand Up @@ -287,6 +293,9 @@ def store(self, target_config: TargetConfig, df: pa.lib.Table = None):
storage_format=storage_format,
)

# extend the storage options with the aws region
storage_options["AWS_REGION"] = self.aws_region

# extend the storage options with the temporary table credentials
storage_options = storage_options | uc_get_storage_credentials(
self.uc_client, self.catalog_name, schema_name, table_name
Expand Down