Skip to content

Queryiterator

flowtask.components.QueryIterator

QueryIterator

QueryIterator(loop=None, job=None, stat=None, **kwargs)

Bases: DBSupport, TemplateSupport, IteratorBase

QueryIterator

Overview

This component creates a Pandas Iterator from a QuerySource query,
allowing for the iteration over data returned from a query.

.. table:: Properties :widths: auto

+------------------------+----------+-----------+--------------------------------------------------------+ | Name | Required | Summary | +------------------------+----------+-----------+--------------------------------------------------------+ | file_sql | No | The SQL file to read the query from. | +------------------------+----------+-----------+--------------------------------------------------------+ | query_slug | No | The query slug to use for fetching data. | +------------------------+----------+-----------+--------------------------------------------------------+ | query | No | The raw SQL query string to execute. | +------------------------+----------+-----------+--------------------------------------------------------+ | conditions | No | Conditions to apply to the query. | +------------------------+----------+-----------+--------------------------------------------------------+ | columns | No | Specific columns to extract from the result. | +------------------------+----------+-----------+--------------------------------------------------------+ | use_template | No | If True, use a query template for the query. Default is False. | +------------------------+----------+-----------+--------------------------------------------------------+ | drop_empty | No | If True, drop empty rows and columns from the DataFrame. | +------------------------+----------+-----------+--------------------------------------------------------+ | dropna | No | Subset of columns to check for NaN values before dropping rows. | +------------------------+----------+-----------+--------------------------------------------------------+

Returns

This component returns the last value generated by the iteration process. Typically, it returns a pandas DataFrame containing the query results.

createJob

createJob(target, params, row)

Create the Job Component.

run async

run()

Async Run Method.

start async

start(**kwargs)

Getting kind of Query.