sql_converter
sql_converter ¶
SQL conversion helpers for DomoDataflow actions.
These helpers provide a lightweight approximation layer that maps Magic ETL action tiles to SQL snippets. The output is intended for analysis and documentation, not direct execution without review.
convert_entire_workflow_to_sql_tiles ¶
convert_entire_workflow_to_sql_tiles(
actions: list[Any],
recommendations: RecommendationSet | None = None,
) -> list[dict[str, Any]]
Convert a full action list into ordered SQL tile approximations.
Each result dict contains
step_number, step_name, tile_id, tile_name, tile_type, input_steps, input_names, output_steps, output_names, conversion_status, sql, applied_rules, placement
applied_rules lists each recommendation rule applied to the tile (rule_id, directive,
value, why, source, level); placement is the join placement advice, else None.
Source code in src/crew_dcs/classes/DomoDataflow/action/sql_converter.py
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
format_conversion_report ¶
format_conversion_report(
tiles: list[dict[str, Any]],
) -> str
Markdown report of a conversion: one line per tile, each applied rule with its reason.
Source code in src/crew_dcs/classes/DomoDataflow/action/sql_converter.py
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | |
tile_operation ¶
tile_operation(action_or_dict: Any) -> str | None
Return the operation a tile performs (formula, join, alter, ...), or None if unclassified.
Source code in src/crew_dcs/classes/DomoDataflow/action/sql_converter.py
46 47 48 | |
tile_to_sql ¶
tile_to_sql(
action_or_dict: Any,
*,
previous_step: str = "source_dataset",
input_steps: list[str] | None = None,
input_names: list[str] | None = None,
recommendations: RecommendationSet | None = None,
output_step: str = "step_out",
) -> str
Convert a single tile/action into SQL approximation.
output_step names the table an ALTER-style tile builds (copy, then alter the copy).
recommendations (see load_recommendations) applies YAML rules; the SQL carries a
comment citing each rule applied. With None, no rule is applied.
Source code in src/crew_dcs/classes/DomoDataflow/action/sql_converter.py
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |