model¶
Data models for AWS Redshift Data API resources.
Ref:
- simple_aws_redshift.redshift_data_api.model.parse_datetime()¶
string -> datetime from a string in most ISO 8601 formats
- class simple_aws_redshift.redshift_data_api.model.DescribeStatementResponse(raw_data: DescribeStatementResponseTypeDef = REQ)[source]¶
API response for https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift-data/client/describe_statement.html
- class simple_aws_redshift.redshift_data_api.model.RedshiftDataType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumeration of Redshift data types as returned by the Data API
- simple_aws_redshift.redshift_data_api.model.type_to_field_mapping = {'_aclitem': 'stringValue', 'bool': 'booleanValue', 'bpchar': 'stringValue', 'char': 'stringValue', 'date': 'stringValue', 'decimal': 'doubleValue', 'float4': 'doubleValue', 'float8': 'doubleValue', 'int2': 'longValue', 'int4': 'longValue', 'int8': 'longValue', 'json': 'stringValue', 'jsonb': 'stringValue', 'name': 'stringValue', 'numeric': 'stringValue', 'oid': 'longValue', 'text': 'stringValue', 'time': 'stringValue', 'timestamp': 'stringValue', 'timestamptz': 'stringValue', 'uuid': 'stringValue', 'varbyte': 'stringValue', 'varchar': 'stringValue'}¶
From redshift column data type to the field key where the value is stored in the Redshift Data API response.
- simple_aws_redshift.redshift_data_api.model.extract_field_raw_value(column_metadata: ColumnMetadataTypeDef, field: FieldTypeDef) Any[source]¶
Extracts the raw value from a Redshift Data API field.
- simple_aws_redshift.redshift_data_api.model.extract_field_python_native_value(column_metadata: ColumnMetadataTypeDef, raw_value: Any) Any[source]¶
Extracts the native Python value from a Redshift Data API field.
- class simple_aws_redshift.redshift_data_api.model.GetStatementResultResponse(raw_data: GetStatementResultResponseTypeDef = REQ)[source]¶
API response for https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift-data/paginator/GetStatementResult.html
- class simple_aws_redshift.redshift_data_api.model.GetStatementResultResponseIterProxy(iterable: Iterable)[source]¶
Iterator proxy for
GetStatementResultResponse.
- class simple_aws_redshift.redshift_data_api.model.VirtualDataFrame(columns: list[str], col_data: dict[str, list[Any]])[source]¶
A virtual dataframe that can represent tabular data in various formats.
- Parameters:
columns – List of column names. Example: [‘col1’, ‘col2’, ‘col3’]
col_data – Dictionary mapping column names to lists of column values. Example: {‘col1’: [1, 2, 3], ‘col2’: [‘a’, ‘b’, ‘c’], ‘col3’: [True, False, True]}
- property rows¶
List of rows in the virtual dataframe.
- property n_columns¶
Number of columns in the virtual dataframe.
- property n_rows¶
Number of rows in the virtual dataframe.
- property pandas_df: DataFrame¶
Convert the virtual dataframe to a pandas DataFrame.
- property polars_df: DataFrame¶
Convert the virtual dataframe to a polars DataFrame.
- class simple_aws_redshift.redshift_data_api.model.ConsolidatedStatementResult(response_list: list[GetStatementResultResponse])[source]¶
Consolidated result from multiple
GetStatementResultResponseinstances.- property vdf: VirtualDataFrame¶
Convert the consolidated results into a VirtualDataFrame.