Skip to content

CloudOptions ​

Namespace: Polars.CSharp

Configuration options for Cloud IO (S3, Azure, GCP, etc).

Properties & Indexers ​

PropertyTypeDescription
CredentialsDictionary<string, string>Key-value pairs for authentication and configuration (e.g., "aws_access_key_id", "endpoint_url").
See Polars documentation for supported keys for each provider.
FileCacheTtlulongTime-to-live for the file cache in seconds. Default is 0 (no cache/default).
MaxRetriesuintMaximum number of retries for cloud requests. Default is 2.
ProviderCloudProviderThe cloud provider to use.
RetryInitBackoffMsulongThe initial backoff time for retries in milliseconds. Default is 500ms.
RetryMaxBackoffMsulongThe maximum backoff time for retries in milliseconds. Default is 10,000ms (10 seconds).
RetryTimeoutMsulongThe timeout for a single cloud request in milliseconds. Default is 30,000ms (30 seconds).

Constructors & Static Methods ​

CloudOptions ​

csharp
public CloudOptions()

Aws ​

Creates options for Amazon S3 or S3-compatible services (like MinIO).

csharp
public static CloudOptions Aws(
    string region,
    string? accessKey = null,
    string? secretKey = null,
    string? endpoint = null,
    string? bucket = null,
    string? sessionToken = null
)

Parameters

NameTypeDescription
regionstringThe AWS region (e.g., "us-east-1").
accessKeystring?AWS Access Key ID.
secretKeystring?AWS Secret Access Key.
endpointstring?Custom endpoint URL (required for MinIO/R2 etc).
bucketstring?Optional bucket name (usually inferred from path).
sessionTokenstring?Optional session token for temporary credentials.

Azure ​

Creates options for Azure Blob Storage or Azure Data Lake Gen2 (ADLS).

csharp
public static CloudOptions Azure(
    string accountName,
    string? accessKey = null,
    string? sasToken = null,
    string? endpoint = null
)

Parameters

NameTypeDescription
accountNamestringThe storage account name.
accessKeystring?The storage account access key (Shared Key).
sasTokenstring?Shared Access Signature (SAS) token. (Mutually exclusive with accessKey).
endpointstring?Custom endpoint URL.

Gcp ​

Creates options for Google Cloud Storage (GCS).

csharp
public static CloudOptions Gcp(string? serviceAccountPath = null)

Parameters

NameTypeDescription
serviceAccountPathstring?Path to the Service Account JSON file. If null, uses default authentication chain.

Http ​

Creates options for generic HTTP/HTTPS sources.

Creates options for generic HTTP/HTTPS with a Bearer token.

csharp
public static CloudOptions Http(Dictionary<string, string> headers)
public static CloudOptions Http(string bearerToken)

Parameters

NameTypeDescription
headersDictionary<string, string>Custom headers (e.g. Authorization) to include in requests.
bearerTokenstringThe bearer token string.

HuggingFace ​

Creates options for Hugging Face datasets (hf://).

csharp
public static CloudOptions HuggingFace(string? token = null)

Parameters

NameTypeDescription
tokenstring?Hugging Face API token. If null, Polars will look for HF_TOKEN env var.

Released under the MIT License. Powered by the Polars Rust core & Apache Arrow.