AthenaQueryPost¶
- pydantic model openapi_client.models.athena_query_post.AthenaQueryPost¶
Request body for POST /queries (start_query_execution). Only QueryString is strictly required; every other property has a server-side default. Unrecognised properties are ignored by the handler.
- Fields:
- field query_string: StrictStr [Required] (alias 'QueryString')¶
The SQL statement to execute. Must be non-empty (empty string is rejected with IPV-1045). When Encoding is “base64” this must be valid base64, otherwise the request is rejected with GE-1034. Statement-specific constraints enforced by the handler: - MERGE INTO against S3 Tables requires WorkGroup “primary”; MERGE INTO otherwise requires WorkGroup “AmazonAthenaEngineV3” (IPV-1071). - ALTER TABLE is only supported when QueryTargetLocation is “athena” (IPV-1069).
- Constraints:
strict = True
- field encoding: Optional[StrictStr] = 'none' (alias 'Encoding')¶
Encoding of QueryString. When “base64” the handler decodes QueryString before execution. Any value other than the two listed is rejected with IPV-1045.
- field work_group: Optional[StrictStr] = 'primary' (alias 'WorkGroup')¶
Athena workgroup to run the query in. Applies only when QueryTargetLocation is “athena”. Note: an unsupported workgroup is rejected with DWH-1033, which the handler raises as InconsistentMetadataException and therefore returns as HTTP 500, not 400.
- field query_target_location: Optional[StrictStr] = 'athena' (alias 'QueryTargetLocation')¶
Query engine to execute against. An unrecognised value is rejected with IPV-1041 (HTTP 400). Selecting “redshift” in an environment whose datalake is not Redshift fails with GE-1036, which the handler raises as GenericFailureException and therefore returns as HTTP 500, not 400.
- field workbook_id: Optional[StrictStr] = 'N/A' (alias 'WorkbookId')¶
Optional workbook to associate this query with. Stored verbatim and defaulted to “N/A” when omitted; the handler does not validate that the workbook exists.
- field assume_role: Optional[StrictStr] = 'no' (alias 'AssumeRole')¶
Whether to execute the query under the caller’s assumed role. Backend behaviour note: the handler only treats the exact string “yes” as enabling this; every other value means no. It is also force-disabled when the query references a system dataset. The enum below is enforced by the API Gateway request validator, not by the Lambda.
- 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 AthenaQueryPost 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 AthenaQueryPost from a dict
- Return type:
Optional[Self]