Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Query
  • Access management
  • Pricing policy
    • Terraform
    • SDK
    • Apache Airflow™
  • Integrations
  • Audit Trails events
  • FAQ

In this article:

  • Return values
  • YQL to Python type mapping
  • Scalar types
  • Complex types
  • Optional types
  • Containers
  • Special types
  1. Reference
  2. Apache Airflow™

Apache Airflow™

Written by
Yandex Cloud
Updated at July 7, 2026
View in Markdown
  • Return values
  • YQL to Python type mapping
    • Scalar types
    • Complex types
    • Optional types
    • Containers
    • Special types

To operate under the Apache Airflow™ management, Yandex Query provides the apache-airflow-providers-yandex package. Apache Airflow™ jobs are Python applications consisting of Apache Airflow™ operators and their dependencies, which decide the order of execution. To make queries to Yandex Query, the package contains the YQExecuteQueryOperator Apache Airflow™ operator.

To run queries against Yandex Query, you need to initialize YQExecuteQueryOperator using the arguments listed below.

Required arguments:

  • name: Apache Airflow™ task name.
  • sql: SQL query to run against Yandex Query.

Optional arguments:

  • folder_id: Target folder for the query. If not specified, it defaults to the Managed Service for Apache Airflow™ folder.
  • yandex_conn_id: Connection ID of type yandexcloud, containing the parameters for connecting to Yandex Cloud. If not specified, defaults to the yandexcloud_default connection. The yandexcloud_default connection comes preconfigured with Managed Service for Apache Airflow™, so you do not need to create it manually.

Here is an example:

yq_operator = YQExecuteQueryOperator(task_id="yq_operator", sql="SELECT 'Hello, world!'")

This example creates an Apache Airflow™ task with ID yq_operator that runs SELECT 'Hello, world!'. For a complete example of running a query in Yandex Query from Managed Service for Apache Airflow™, refer to Automating Yandex Query tasks with Yandex Managed Service for Apache Airflow™.

Return valuesReturn values

A successful YQExecuteQueryOperator returns data as a dict that contains an array of column descriptions and an array of result rows.

Query:

yq_operator = YQExecuteQueryOperator(task_id="yq_operator", sql="SELECT 'Hello, World!'")

Result:

{
  'rows': [['Hello, world!']],
  'columns': [{'name': 'column0', 'type': 'String'}]
}
Field Description
columns Result column array
columns[].name Column name
columns[].type Column data type
rows Result row array Each row array’s element count matches the number of columns in the columns field

YQL to Python type mappingYQL to Python type mapping

The following rules apply when converting YQL types to Python types.

Scalar typesScalar types

YQL type Python type Python example
Int8, Int16, Int32, Uint8, Uint16, Uint32, Int64, Uint64 int 647713
Bool bool True
Float, Double double
NaN and Inf become None
7.88731023
None
Decimal Decimal 45.23410083
Utf8 str String text
String str
bytes
String text

Complex typesComplex types

YQL type Python type Python example
Json, JsonDocument str (whole node serialized to a string) {"a":[1,2,3]}
Date, Datetime, Timestamp datetime 2022-02-09

Optional typesOptional types

YQL type Python type Python example
Optional Original type or None 1

ContainersContainers

YQL type Python type Python example
List<Type> list [1,2,3,4]
Dict<KeyType, ValueType> dict {key1: value1, key2: value2}
Set<KeyType> set set(key_value1, key_value2)
Tuple<Type1, Type2> tuple (element1, element2, ..)
Struct<Name:Utf8,Age:Int32> dict { "Name": "John", "Age": 128 }
Variant<Type1, Type2> with a tuple list list[64563, 1]
Variant<value:Int32,error:String> structured string dict {key1: value1, key2: value2}

Special typesSpecial types

YQL type Python type
Void, Null None
EmptyList []
EmptyDict {}

Useful linksUseful links

  • Automating Yandex Query tasks with Yandex Managed Service for Apache Airflow™

Was the article helpful?

Previous
YQL to JSON type mapping
Next
Integrations
© 2026 Direct Cursus Technology L.L.C.