-
Notifications
You must be signed in to change notification settings - Fork 229
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
Fix/add s3 region for redshift staging destination related to 2349 #2389
base: devel
Are you sure you want to change the base?
Changes from 4 commits
9d5bfd4
2164cc3
41d127c
36f176d
6d93da3
683b91a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,9 +65,11 @@ def __init__( | |
file_path: str, | ||
staging_credentials: Optional[CredentialsConfiguration] = None, | ||
staging_iam_role: str = None, | ||
staging_region_name: str = None, | ||
) -> None: | ||
super().__init__(file_path, staging_credentials) | ||
self._staging_iam_role = staging_iam_role | ||
self._region_name = staging_region_name | ||
self._job_client: "RedshiftClient" = None | ||
|
||
def run(self) -> None: | ||
|
@@ -76,15 +78,22 @@ def run(self) -> None: | |
credentials = "" | ||
if self._staging_iam_role: | ||
credentials = f"IAM_ROLE '{self._staging_iam_role}'" | ||
if self._region_name: | ||
credentials += f" REGION '{self._region_name}'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yannik207 it should be possible to use |
||
elif self._staging_credentials and isinstance( | ||
self._staging_credentials, AwsCredentialsWithoutDefaults | ||
): | ||
aws_access_key = self._staging_credentials.aws_access_key_id | ||
aws_secret_key = self._staging_credentials.aws_secret_access_key | ||
region_name = self._staging_credentials.region_name | ||
credentials = ( | ||
"CREDENTIALS" | ||
f" 'aws_access_key_id={aws_access_key};aws_secret_access_key={aws_secret_key}'" | ||
f" 'aws_access_key_id={aws_access_key};aws_secret_access_key={aws_secret_key}" | ||
) | ||
if region_name: | ||
yannik207 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
credentials += f"region={region_name};" | ||
|
||
credentials += "'" # Closing single quote | ||
|
||
# get format | ||
ext = os.path.splitext(self._bucket_path)[1][1:] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would have to be made part of the
RedshiftClientConfiguration
and then passed to the load-jobThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2nd thought here: if we add to the configuration, we will have to add a lot of tests, i assume so maybe let me have a chat with my colleagues here
@sh-rp