upload_file_to_dataset

DatasetsApi.upload_file_to_dataset(id, role_id, file_upload, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Upload file to dataset from query result

Starts asynchronous upload of Athena query results into the dataset (Step Functions). Body requires QueryId and FileName. Caller must be owner or editor. Query output size and dataset FileType constraints apply (e.g. ~500MB limit; unsupported types rejected).

Parameters:
  • id (str) – Destination dataset ID. (required)

  • role_id (str) – Amorphic role ID. Caller must be owner or editor. (required)

  • file_upload (FileUpload) – (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

UploadFileToDatasetResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /datasets/{id}/files

Request

Request / response example

{
  "QueryId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "FileName": "monthly_report.csv"
}

Success (HTTP 200)

Upload initiated asynchronously.

Request / response example

{
  "Message": "Query results file upload has been initiated for dataset monthly_orders"
}

Errors

Documented error codes: GE-1034.

HTTP 400

Validation/auth failure. Includes query access/status errors and GE-1034 for size/FileType issues.

Query result too large

{
  "Message": "GE-1034 - Query results exceed maximum supported size"
}

HTTP 500

Backend failure initiating upload.