QueryResponse¶
- pydantic model openapi_client.models.query_response.QueryResponse¶
A single query record. Field availability varies by engine and by lifecycle state, so no property is guaranteed present. In particular WorkGroup, WorkbookId and QuerySource are written only on the Athena path (and the Redshift CTAS path) and are absent from plain Redshift query records. When projectionExpression is supplied on the request, only the requested keys are returned.
- Fields:
- field query_id: Optional[StrictStr] = None (alias 'QueryId')¶
Unique identifier of the query execution.
- field query_string: Optional[StrictStr] = None (alias 'QueryString')¶
The SQL statement that was submitted.
- field query_status: Optional[StrictStr] = None (alias 'QueryStatus')¶
Current execution state. QUEUED and CANCELLING are transient. Redshift engine states are normalised onto this set: FINISHED maps to SUCCEEDED, STARTED to RUNNING, ABORTED to CANCELLED.
- field query_target_location: Optional[StrictStr] = None (alias 'QueryTargetLocation')¶
Engine the query was executed against.
- field work_group: Optional[StrictStr] = None (alias 'WorkGroup')¶
Athena workgroup the query ran in. Present on Athena records only. The value is copied from whatever the engine reports, and stored records are returned verbatim, so on reads it is not constrained to the values accepted at submission time.
- field user_id: Optional[StrictStr] = None (alias 'UserId')¶
Identifier of the user who submitted the query.
- field created_by: Optional[StrictStr] = None (alias 'CreatedBy')¶
User who created the query record.
- field creation_time: Optional[StrictStr] = None (alias 'CreationTime')¶
Timestamp at which the query was submitted.
- field last_modified_time: Optional[StrictStr] = None (alias 'LastModifiedTime')¶
Timestamp of the most recent update to the query record.
- field message: Optional[StrictStr] = None (alias 'Message')¶
Explanatory text. Set when the query failed, and also used to carry the confirmation text for statements that return no result set (CREATE, MERGE INTO, VACUUM).
- field results_download_link: Optional[StrictStr] = None (alias 'ResultsDownloadLink')¶
Location of the result file. This value has two distinct forms: for records already in a terminal state and served straight from storage it is a raw “s3://bucket/key” URI, whereas for records refreshed against the live engine it is a time-limited presigned “https://” URL. Absent for CREATE, MERGE INTO and VACUUM queries.
- field workbook_id: Optional[StrictStr] = None (alias 'WorkbookId')¶
Workbook the query was associated with at submission. Absent on plain Redshift query records.
- field query_source: Optional[StrictStr] = None (alias 'QuerySource')¶
Origin of the query. Absent on plain Redshift query records.
- field retry_execution_ids: Optional[List[StrictStr]] = None (alias 'RetryExecutionIds')¶
Execution identifiers of previous attempts. Present when the query was retried automatically, for example after a role-permission update.
- field cancelled_by: Optional[StrictStr] = None (alias 'CancelledBy')¶
User who cancelled the query. Present on cancelled queries only.
- field cancellation_time: Optional[StrictStr] = None (alias 'CancellationTime')¶
Timestamp at which cancellation was requested. Present on cancelled queries only.
- field execution_time_at_cancellation_seconds: Optional[StrictInt] = None (alias 'ExecutionTimeAtCancellationSeconds')¶
Number of seconds the query had been running when cancellation was requested. Present on cancelled queries only.
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- classmethod from_json(json_str)¶
Create an instance of QueryResponse from a JSON string
- Return type:
Optional[Self]
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
Dict[str,Any]
- classmethod from_dict(obj)¶
Create an instance of QueryResponse from a dict
- Return type:
Optional[Self]