Skip to main content

S3Backend

An S3 task result store.

Attributes

AttributeTypeDescription
endpoint_urlstringThe custom URL for the S3 service endpoint used to connect to non-AWS S3 compatible services.
aws_regionstringThe AWS region name where the S3 bucket is located for establishing the session connection.
aws_access_key_idstringThe AWS access key credential used for authenticating requests to the S3 service.
aws_secret_access_keystringThe AWS secret access key credential used for authenticating requests to the S3 service.
bucket_namestringThe name of the S3 bucket where task results are stored; this value is required for the backend to function.
base_pathstringAn optional prefix or directory path prepended to all keys stored in the S3 bucket.
_s3_resourceobjectThe internal boto3 S3 resource instance used to perform object operations like get, put, and delete.

Constructor

Signature

def S3Backend(
**kwargs: dict
)

Parameters

NameTypeDescription
**kwargsdictArbitrary keyword arguments passed to the parent KeyValueStoreBackend class.

Signature

def S3Backend(
**kwargs: dict
)

Parameters

NameTypeDescription
**kwargsdictArbitrary keyword arguments passed to the parent KeyValueStoreBackend class.

Methods


get()

@classmethod
def get(
key: str | bytes
) - > str | bytes | null

Retrieves the content of a task result from S3, returning None if the key does not exist.

Parameters

NameTypeDescription
key`strbytes`

Returns

TypeDescription
`strbytes

set()

@classmethod
def set(
key: str | bytes,
value: str | bytes
)

Uploads the provided value to the S3 bucket using the specified key.

Parameters

NameTypeDescription
key`strbytes`
value`strbytes`

delete()

@classmethod
def delete(
key: str | bytes
)

Removes the task result object associated with the given key from the S3 bucket.

Parameters

NameTypeDescription
key`strbytes`