QueryAsset
An asset made from a SQL query
Parameters
Name Description query
The query to be used to construct the underlying Data Asset
Adds a daily Batch Definition to this Data Asset
Parameters
Name Description name
The name of the Batch Definition to be added
Returns
Type Description BatchDefinition
The added BatchDefinition object.
Adds a monthly Batch Definition to this Data Asset
Parameters
Name Description name
The name of the Batch Definition to be added
Returns
Type Description BatchDefinition
The added BatchDefinition object.
Adds a whole table Batch Definition to this Data Asset
Parameters
Name Description name
The name of the Batch Definition to be added
Returns
Type Description BatchDefinition
The added BatchDefinition object.
Adds a yearly Batch Definition to this Data Asset
Parameters
Name Description name
The name of the Batch Definition to be added.
Returns
Type Description BatchDefinition
The added BatchDefinition object.
Delete a batch definition.
Parameters
Name Description name (str)
Name of the BatchDefinition to delete.
Get a batch definition.
Parameters
Name Description name (str)
Name of the BatchDefinition to get.
Raises
Type Description KeyError
If the BatchDefinition does not exist.
Validates that the Batch Definition column is of a permissible type
- This isn't meant to be called directly. This is called internally when a Batch Definition
is added. Data asset implementers can override this for their specific data asset.
Raises
Type Description SqlAddBatchDefinitionError
The specified column to partition on is not of a permissible type for batching (ie date or datetime) or no data is present in this column.
class great_expectations.datasource.fluent.sql_datasource.QueryAsset(*, name: str, type: typing.Literal['query'] = 'query', id: <pydantic.v1.fields.DeferredType object at 0x7f20593a6540> = None, order_by: <pydantic.v1.fields.DeferredType object at 0x7f20593a65d0> = None, batch_metadata: <pydantic.v1.fields.DeferredType object at 0x7f20593a6780> = None, batch_definitions: <pydantic.v1.fields.DeferredType object at 0x7f20593a6930> = None, query: str)
Methods
add_batch_definition_daily(name: str, column: str, sort_ascending: bool = True, validate_batchable: bool = True) → BatchDefinition
add_batch_definition_monthly(name: str, column: str, sort_ascending: bool = True, validate_batchable: bool = True) → BatchDefinition
add_batch_definition_whole_table(name: str) → BatchDefinition
add_batch_definition_yearly(name: str, column: str, sort_ascending: bool = True, validate_batchable: bool = True) → BatchDefinition
delete_batch_definition(name: str) → None
get_batch_definition(name: str) → great_expectations.core.batch_definition.BatchDefinition
validate_batch_definition(partitioner: Union[great_expectations.core.partitioners.PartitionerColumnValue, great_expectations.core.partitioners.PartitionerMultiColumnValue, great_expectations.core.partitioners.PartitionerDividedInteger, great_expectations.core.partitioners.PartitionerModInteger, great_expectations.core.partitioners.ColumnPartitionerYearly, great_expectations.core.partitioners.ColumnPartitionerMonthly, great_expectations.core.partitioners.ColumnPartitionerDaily, great_expectations.core.partitioners.PartitionerDatetimePart, great_expectations.core.partitioners.PartitionerConvertedDatetime]) → None