Skip to main content
Version: devel

dlt._workspace.helpers.dashboard.utils.queries

SQL query execution, row counts, and load history retrieval.

clear_query_cache

def clear_query_cache() -> None

View source on GitHub

Clear the cached query results.

update_query_history

def update_query_history(current_history: Dict[str, int], query: str,
row_count: int) -> Dict[str, int]

View source on GitHub

Update query history dict, placing most recent query first.

get_default_query_for_table

def get_default_query_for_table(pipeline: dlt.Pipeline, schema_name: str,
table_name: str,
limit: bool) -> Tuple[str, str, str]

View source on GitHub

Build a default SELECT query for a table. Returns (sql_query, error_message, traceback).

get_example_query_for_dataset

def get_example_query_for_dataset(pipeline: dlt.Pipeline,
schema_name: str) -> Tuple[str, str, str]

View source on GitHub

Return an example query for the first data table in the schema.

Returns (sql_query, error_message, traceback).

get_query_result

def get_query_result(pipeline: dlt.Pipeline,
query: str) -> Tuple[pyarrow.Table, str, str]

View source on GitHub

Get the result of a query.

Parses the query to ensure it is valid SQL before sending it to the destination.

get_row_counts

def get_row_counts(pipeline: dlt.Pipeline,
selected_schema_name: str = None,
load_id: str = None) -> Dict[str, int]

View source on GitHub

Get the row counts for a pipeline as a dict of {table_name: count}.

get_row_counts_list

def get_row_counts_list(
pipeline: dlt.Pipeline,
selected_schema_name: str = None,
load_id: str = None) -> List[Dict[str, Union[str, int]]]

View source on GitHub

Get the row counts for a pipeline as a list of {name, row_count} dicts.

get_loads

def get_loads(c: DashboardConfiguration,
pipeline: dlt.Pipeline,
limit: int = 100
) -> Tuple[List[TLoadItem], Optional[str], Optional[str]]

View source on GitHub

Get the loads of a pipeline. Returns (loads_list, error_message, traceback).

build_load_details

def build_load_details(pipeline: dlt.Pipeline,
load: TLoadItem) -> List[mo.Html]

View source on GitHub

Build the load detail widgets: row counts and schema version accordion.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.