snowshu.core.compile

class snowshu.core.compile.RuntimeSourceCompiler

Bases: object

static compile_queries_for_relation(relation: snowshu.core.models.relation.Relation, dag: networkx.classes.graph.Graph, source_adapter: Type[snowshu.adapters.source_adapters.base_source_adapter.BaseSourceAdapter], analyze: bool) → snowshu.core.models.relation.Relation

Generates the sql statements for the given relation

Parameters
  • relation (Relation) – the relation to generate the sql for

  • dag (Graph) – the connected dependency graph that contains the relation

  • source_adapter (BaseSourceAdapter) – the source adapter for the sql dialect

  • analyze (bool) – whether to generate sql statements for analyze or actaul sampling

Returns

the given relation with compiled_query populated

Return type

Relation