Skip to content

Commit

Permalink
feat(sdk): added ability to set S3 endpoint url if needed (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
maocorte authored Jun 25, 2024
1 parent 555048d commit c6a8f14
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions sdk/radicalbit_platform_sdk/apis/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ def load_reference_dataset(
if aws_credentials is None
else aws_credentials.default_region
),
endpoint_url=(
None
if aws_credentials is None
else (
None
if aws_credentials.endpoint_url is None
else aws_credentials.endpoint_url
)
),
)

s3_client.upload_file(
Expand Down Expand Up @@ -237,6 +246,15 @@ def bind_reference_dataset(
region_name=(
None if aws_credentials is None else aws_credentials.default_region
),
endpoint_url=(
None
if aws_credentials is None
else (
None
if aws_credentials.endpoint_url is None
else aws_credentials.endpoint_url
)
),
)

chunks_iterator = s3_client.get_object(
Expand Down Expand Up @@ -314,6 +332,15 @@ def load_current_dataset(
if aws_credentials is None
else aws_credentials.default_region
),
endpoint_url=(
None
if aws_credentials is None
else (
None
if aws_credentials.endpoint_url is None
else aws_credentials.endpoint_url
)
),
)

s3_client.upload_file(
Expand Down Expand Up @@ -372,6 +399,15 @@ def bind_current_dataset(
region_name=(
None if aws_credentials is None else aws_credentials.default_region
),
endpoint_url=(
None
if aws_credentials is None
else (
None
if aws_credentials.endpoint_url is None
else aws_credentials.endpoint_url
)
),
)

chunks_iterator = s3_client.get_object(
Expand Down
3 changes: 3 additions & 0 deletions sdk/radicalbit_platform_sdk/models/aws_credentials.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from typing import Optional

from pydantic import BaseModel


class AwsCredentials(BaseModel):
access_key_id: str
secret_access_key: str
default_region: str
endpoint_url: Optional[str]

0 comments on commit c6a8f14

Please sign in to comment.