Skip to content

Commit

Permalink
Plumb python support
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Jan 30, 2024
1 parent 6b96597 commit 90c75e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ public interface Builder {

Builder endpointOverride(URI endpointOverride);

default Builder endpointOverride(String endpointOverride) {
return endpointOverride(URI.create(endpointOverride));
}

S3Instructions build();
}

Expand Down
7 changes: 6 additions & 1 deletion py/server/deephaven/experimental/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def __init__(self,
read_timeout: Union[
Duration, int, str, datetime.timedelta, np.timedelta64, pd.Timedelta, None] = None,
aws_access_key_id: Optional[str] = None,
aws_secret_access_key: Optional[str] = None):
aws_secret_access_key: Optional[str] = None,
endpoint_override: Optional[str] = None):

"""
Initializes the instructions.
Expand Down Expand Up @@ -68,6 +69,7 @@ def __init__(self,
aws_secret_access_key (str): the AWS secret access key for reading parquet files stored in AWS S3. Both
access key and secret key must be provided to use static credentials, else default credentials will be
used from software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider.
endpoint_override (str): the endpoint with which the SDK should communicate.
Raises:
DHError: If unable to build the instructions object.
Expand Down Expand Up @@ -102,6 +104,9 @@ def __init__(self,
if aws_access_key_id is not None:
builder.credentials(_JAwsCredentials.basicCredentials(aws_access_key_id, aws_secret_access_key))

if endpoint_override is not None:
builder.endpointOverride(endpoint_override)

self._j_object = builder.build()
except Exception as e:
raise DHError(e, "Failed to build S3 instructions") from e
Expand Down

0 comments on commit 90c75e3

Please sign in to comment.