Skip to content

Query

laktory.models.resources.databricks.Query ¤

Bases: BaseModel, PulumiResource, TerraformResource

Databricks Query

ATTRIBUTE DESCRIPTION
access_controls

Query access controls

TYPE: list[AccessControl]

dirpath

Workspace directory inside rootpath in which the query is deployed. Used only if parent_path is not specified.

TYPE: str

display_name

Name of the query.

TYPE: str

query_text

Text of SQL query.

TYPE: str

warehouse_id

ID of a SQL warehouse which will be used to execute this query.

TYPE: str

apply_auto_limit

Whether to apply a 1000 row limit to the query result.

TYPE: bool

catalog

Name of the catalog where this query will be executed.

TYPE: str

description

General description that conveys additional information about this query such as usage notes.

TYPE: str

owner_user_name

Query owner's username.

TYPE: str

parameters

Query parameter definition. Consists of following attributes (one of *_value is required):

TYPE: list[QueryParameter]

parent_path

The path to a workspace folder containing the query. Set to None to use user's home folder. Overwrite rootpath and dirpath. If changed, the query will be recreated.

TYPE: Union[str, None]

rootpath

Root directory to which all queries are deployed to. Can also be configured by settings LAKTORY_WORKSPACE_LAKTORY_ROOT environment variable. Default is /.laktory/. Used only if parent_path is not specified.

TYPE: str

run_as_mode

Sets the "Run as" role for the object.

TYPE: str

schema

Name of the schema where this query will be executed.

tags

Tags that will be added to the query.

TYPE: list[str]

Examples:

from laktory import models

query = models.resources.databricks.Query(
    display_name="google-prices",
    parent_path="/queries",
    query_text="SELECT * FROM dev.finance.slv_stock_prices",
    warehouse_id="12345",
)
ATTRIBUTE DESCRIPTION
additional_core_resources
  • permissions

TYPE: list[PulumiResource]

Attributes¤

additional_core_resources property ¤

additional_core_resources
  • permissions
  • alert

--

laktory.models.resources.databricks.query.QueryParameter ¤

Bases: BaseModel

Query Parameters Specifications

ATTRIBUTE DESCRIPTION
name

Literal parameter marker that appears between double curly braces in the query text.

TYPE: str

date_range_value

Date-range query parameter value. Consists of following attributes (Can only specify one of dynamic_date_range_value or date_range_value)

TYPE: QueryParameterDateRangeValue

date_value

Date query parameter value. Consists of following attributes (Can only specify one of dynamic_date_value or date_value)

TYPE: QueryParameterDateValue

enum_value

Dropdown parameter value

TYPE: QueryParameterEnumValue

numeric_value

Numeric parameter value

TYPE: QueryParameterNumericValue

query_backed_value

Query-based dropdown parameter value

TYPE: QueryParameterQueryBackedValue

text_value

Text parameter value

TYPE: QueryParameterTextValue

title

Text displayed in the user-facing parameter widget in the UI.

TYPE: str

--

laktory.models.resources.databricks.query.QueryParameterDateRangeValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
date_range_value

Manually specified date-time range value

TYPE: QueryParameterDateRangeValueDateRangeValue

dynamic_date_range_value

Dynamic date-time range value based on current date-time.

TYPE: Literal['TODAY', 'YESTERDAY', 'THIS_WEEK', 'THIS_MONTH', 'THIS_YEAR', 'LAST_WEEK', 'LAST_MONTH', 'LAST_YEAR', 'LAST_HOUR', 'LAST_8_HOURS', 'LAST_24_HOURS', 'LAST_7_DAYS', 'LAST_14_DAYS', 'LAST_30_DAYS', 'LAST_60_DAYS', 'LAST_90_DAYS', 'LAST_12_MONTHS']

--

laktory.models.resources.databricks.query.QueryParameterDateRangeValueDateRangeValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
end

end of the date range

TYPE: str

start

start of the date range

TYPE: str

--

laktory.models.resources.databricks.query.QueryParameterDateValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
date_value

Manually specified date-time value

TYPE: str

dynamic_date_value

Dynamic date-time value based on current date-time

TYPE: Literal['NOW', 'YESTERDAY']

precision

Date-time precision to format the value into when the query is run.

TYPE: Literal['DAY_PRECISION', 'MINUTE_PRECISION', 'SECOND_PRECISION']

--

laktory.models.resources.databricks.query.QueryParameterEnumValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
enum_options

List of valid query parameter values, newline delimited.

TYPE: str

multi_values_options

If specified, allows multiple values to be selected for this parameter.

TYPE: QueryParameterEnumValueMultiValuesOptions

values

List of selected query parameter values.

TYPE: list[str]

--

laktory.models.resources.databricks.query.QueryParameterEnumValueMultiValuesOptions ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
prefix

Character that prefixes each selected parameter value.

TYPE: str

separator

Character that separates each selected parameter value. Defaults to a comma.

TYPE: str

suffix

Character that suffixes each selected parameter value.

TYPE: str

--

laktory.models.resources.databricks.query.QueryParameterNumericValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
value

Actual numeric value

TYPE: float

--

laktory.models.resources.databricks.query.QueryParameterQueryBackedValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
query_id

ID of the query that provides the parameter values.

TYPE: str

multi_values_options

If specified, allows multiple values to be selected for this parameter.

TYPE: QueryParameterQueryBackedValueMultiValuesOptions

values

List of selected query parameter values.

TYPE: list[str]

--

laktory.models.resources.databricks.query.QueryParameterQueryBackedValueMultiValuesOptions ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
prefix

Character that prefixes each selected parameter value.

TYPE: str

separator

Character that separates each selected parameter value. Defaults to a comma.

TYPE: str

suffix

Character that suffixes each selected parameter value.

TYPE: str

--

laktory.models.resources.databricks.query.QueryParameterTextValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
value

Actual text value.

TYPE: str