Skip to content

How to link Checks to their SQL Queries in scan results? #2475

@moucode

Description

@moucode

Hello,

I'm using Soda Core 3.5.2 with the Soda Library Python API to implement data quality monitoring. We use the scan.get_scan_results() method which returns a dictionary containing:

checks[] - our data quality check results
queries[] - the SQL queries executed during the scan
metrics[] - the metric values

Our Challenge
We need to establish a relationship between checks and their corresponding queries to store them in a relational database structure. We want to be able to query which SQL was executed for a specific check, especially for failed checks.

What we've observed

  1. Each check in checks[] has various metadata (identity, name, type, outcome, etc.)
  2. The queries[] array contains SQL queries with names, durations, and SQL text
  3. We need to understand how these two arrays relate to each other

My Questions

  1. What is the correct way to link a check to its executed SQL queries? Is there a specific field or pattern i should use?
  2. How can I determine which query (or queries) were executed for a specific check?

Any guidance on how to establish this relationship would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions