data-flow-control 0.3.0__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/Cargo.lock +3 -3
  2. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/Cargo.toml +1 -1
  3. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/PKG-INFO +1 -1
  4. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/catalog/dimension.rs +173 -52
  5. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/pyproject.toml +1 -1
  6. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/LICENSE +0 -0
  7. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/Cargo.toml +0 -0
  8. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/benches/rewrite_perf.rs +0 -0
  9. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/aggregate_registry.rs +0 -0
  10. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/catalog/constraint_subquery.rs +0 -0
  11. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/catalog.rs +0 -0
  12. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/diagnostics.rs +0 -0
  13. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/explain.rs +0 -0
  14. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/full_push.rs +0 -0
  15. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/identifiers.rs +0 -0
  16. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/intern.rs +0 -0
  17. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/ir.rs +0 -0
  18. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/lib.rs +0 -0
  19. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/optimizer.rs +0 -0
  20. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/parser.rs +0 -0
  21. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/partial_push.rs +0 -0
  22. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/planner.rs +0 -0
  23. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy.rs +0 -0
  24. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_compile.rs +0 -0
  25. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_index.rs +0 -0
  26. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_parser.rs +0 -0
  27. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_pgn.pest +0 -0
  28. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_store/branch.rs +0 -0
  29. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_store/compiled.rs +0 -0
  30. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_store/delete.rs +0 -0
  31. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_store/indexes.rs +0 -0
  32. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_store/memory.rs +0 -0
  33. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/policy_store/mod.rs +0 -0
  34. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/query_analysis.rs +0 -0
  35. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/resolution_placement.rs +0 -0
  36. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/resolution_registry.rs +0 -0
  37. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewrite_stats.rs +0 -0
  38. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewrite_strategy.rs +0 -0
  39. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/aggregates.rs +0 -0
  40. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/columns.rs +0 -0
  41. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/constraint_preprocess.rs +0 -0
  42. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/derived_policy.rs +0 -0
  43. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/dimensions.rs +0 -0
  44. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/exists.rs +0 -0
  45. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/expr.rs +0 -0
  46. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/helpers.rs +0 -0
  47. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/insert_output_policy.rs +0 -0
  48. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/joint_lineage/grouped_projection.rs +0 -0
  49. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/joint_lineage/terminal_distinct.rs +0 -0
  50. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/joint_lineage/terminal_except.rs +0 -0
  51. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/joint_lineage/terminal_intersect.rs +0 -0
  52. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/joint_lineage.rs +0 -0
  53. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/limit.rs +0 -0
  54. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/mod.rs +0 -0
  55. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/output_scope.rs +0 -0
  56. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/plan/actions.rs +0 -0
  57. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/plan/applicability.rs +0 -0
  58. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/plan/dominance.rs +0 -0
  59. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/plan/mod.rs +0 -0
  60. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/plan/scope_plan.rs +0 -0
  61. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/plan/write_plan.rs +0 -0
  62. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/policy_expr.rs +0 -0
  63. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/projection.rs +0 -0
  64. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/resolution.rs +0 -0
  65. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/scope.rs +0 -0
  66. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/select.rs +0 -0
  67. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/sink_columns.rs +0 -0
  68. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/types.rs +0 -0
  69. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/rewriter/write_path.rs +0 -0
  70. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/semiring.rs +0 -0
  71. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_set_index.rs +0 -0
  72. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_sets/analysis.rs +0 -0
  73. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_sets/annotations.rs +0 -0
  74. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_sets/branch.rs +0 -0
  75. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_sets/mod.rs +0 -0
  76. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_sets/rewrites.rs +0 -0
  77. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/source_sets/split.rs +0 -0
  78. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/ast_stats.rs +0 -0
  79. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/builders.rs +0 -0
  80. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/columns.rs +0 -0
  81. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/dialect.rs +0 -0
  82. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/expr.rs +0 -0
  83. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/expr_key.rs +0 -0
  84. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/mod.rs +0 -0
  85. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/parse.rs +0 -0
  86. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/sql/render.rs +0 -0
  87. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/statement_tables.rs +0 -0
  88. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/src/threshold.rs +0 -0
  89. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/common/duckdb.rs +0 -0
  90. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/common/mod.rs +0 -0
  91. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/conformance.rs +0 -0
  92. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/main.rs +0 -0
  93. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/partial_push.rs +0 -0
  94. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/pgn.rs +0 -0
  95. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/pgn_unique.rs +0 -0
  96. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/policy_storage.rs +0 -0
  97. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/rewrite_api_parity.rs +0 -0
  98. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/semiring.rs +0 -0
  99. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/source_sets.rs +0 -0
  100. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/symmetric_self_join.rs +0 -0
  101. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/threshold.rs +0 -0
  102. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/completion/unique_not_unique.rs +0 -0
  103. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/dialect.rs +0 -0
  104. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/execution/insert.rs +0 -0
  105. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/execution/kill.rs +0 -0
  106. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/execution/main.rs +0 -0
  107. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/execution/oracle.rs +0 -0
  108. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/execution/remove.rs +0 -0
  109. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/execution/update.rs +0 -0
  110. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/expected/duckdb/remove_scan.sql +0 -0
  111. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/expected/postgres/remove_scan.sql +0 -0
  112. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/expected/sqlite/remove_scan.sql +0 -0
  113. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/explain_strategy.rs +0 -0
  114. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/column_propagation.rs +0 -0
  115. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/dimensions.rs +0 -0
  116. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/exists_join.rs +0 -0
  117. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/having_where.rs +0 -0
  118. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/identifiers.rs +0 -0
  119. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/insert_shapes.rs +0 -0
  120. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/main.rs +0 -0
  121. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/multi_source.rs +0 -0
  122. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/operators.rs +0 -0
  123. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/query_shapes.rs +0 -0
  124. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/gaps/scalar_subquery.rs +0 -0
  125. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/indexed_candidate_differential.rs +0 -0
  126. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/insert_values_body.rs +0 -0
  127. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/kill_null_guard_regression.rs +0 -0
  128. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/paper_examples.rs +0 -0
  129. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/parser.rs +0 -0
  130. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/planner.rs +0 -0
  131. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/policy.rs +0 -0
  132. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/policy_dialect.rs +0 -0
  133. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/policy_store_memory.rs +0 -0
  134. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/derived_policy.rs +0 -0
  135. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/in_semijoin.rs +0 -0
  136. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/insert.rs +0 -0
  137. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/joins.rs +0 -0
  138. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/main.rs +0 -0
  139. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/meal_deduction.rs +0 -0
  140. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/output.rs +0 -0
  141. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/recursive.rs +0 -0
  142. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/scan.rs +0 -0
  143. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite/update.rs +0 -0
  144. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite_candidate_regression.rs +0 -0
  145. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite_fast_paths.rs +0 -0
  146. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite_large_registry.rs +0 -0
  147. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/rewrite_stats_timings.rs +0 -0
  148. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/scan_ready_expr.rs +0 -0
  149. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/source_set_split_no_parse.rs +0 -0
  150. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/sql_builders.rs +0 -0
  151. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/sql_columns.rs +0 -0
  152. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-core/tests/ui_resolution.rs +0 -0
  153. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/Cargo.toml +0 -0
  154. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/bindings/catalog.rs +0 -0
  155. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/bindings/errors.rs +0 -0
  156. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/bindings/mod.rs +0 -0
  157. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/bindings/planner.rs +0 -0
  158. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/bindings/policy.rs +0 -0
  159. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/bindings/stats.rs +0 -0
  160. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/passant-py/src/lib.rs +0 -0
  161. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/__init__.py +0 -0
  162. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/_rust.py +0 -0
  163. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/__init__.py +0 -0
  164. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/_retry.py +0 -0
  165. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/base.py +0 -0
  166. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/clickhouse.py +0 -0
  167. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/datafusion.py +0 -0
  168. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/duckdb.py +0 -0
  169. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/duckdb_policy_binding.py +0 -0
  170. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/kill.py +0 -0
  171. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/pg_catalog.py +0 -0
  172. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/postgres.py +0 -0
  173. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/registry.py +0 -0
  174. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/sqlite.py +0 -0
  175. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/adapters/umbra.py +0 -0
  176. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/aggregate_introspection.py +0 -0
  177. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/catalog.py +0 -0
  178. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/connection.py +0 -0
  179. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/dialect.py +0 -0
  180. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/errors.py +0 -0
  181. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/__init__.py +0 -0
  182. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/agent.py +0 -0
  183. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/call_tool_with_dataflow.py +0 -0
  184. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/database.py +0 -0
  185. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/middleware.py +0 -0
  186. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/schema.py +0 -0
  187. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/sql_validation.py +0 -0
  188. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/tool_spec.py +0 -0
  189. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/langchain/wrapper.py +0 -0
  190. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/options.py +0 -0
  191. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/planner.py +0 -0
  192. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/policy.py +0 -0
  193. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/tools/__init__.py +0 -0
  194. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/tools/retry.py +0 -0
  195. {data_flow_control-0.3.0 → data_flow_control-0.3.1}/python/data_flow_control/ui.py +0 -0
@@ -1593,7 +1593,7 @@ dependencies = [
1593
1593
 
1594
1594
  [[package]]
1595
1595
  name = "passant-cli"
1596
- version = "0.3.0"
1596
+ version = "0.3.1"
1597
1597
  dependencies = [
1598
1598
  "anyhow",
1599
1599
  "assert_cmd",
@@ -1605,7 +1605,7 @@ dependencies = [
1605
1605
 
1606
1606
  [[package]]
1607
1607
  name = "passant-core"
1608
- version = "0.3.0"
1608
+ version = "0.3.1"
1609
1609
  dependencies = [
1610
1610
  "anyhow",
1611
1611
  "criterion",
@@ -1623,7 +1623,7 @@ dependencies = [
1623
1623
 
1624
1624
  [[package]]
1625
1625
  name = "passant-py"
1626
- version = "0.3.0"
1626
+ version = "0.3.1"
1627
1627
  dependencies = [
1628
1628
  "passant-core",
1629
1629
  "pyo3",
@@ -3,7 +3,7 @@ members = ["passant-core", "passant-py"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "0.3.0"
6
+ version = "0.3.1"
7
7
  edition = "2024"
8
8
  license = "MIT"
9
9
  authors = ["Charlie Summers"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: data-flow-control
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Requires-Dist: duckdb>=1.3.0
5
5
  Requires-Dist: numpy>=1.24.4
6
6
  Requires-Dist: sqlglot==28.3.0
@@ -6,7 +6,7 @@ use crate::{
6
6
  };
7
7
  use sqlparser::ast::{
8
8
  Expr, FunctionArg, FunctionArgExpr, FunctionArguments, JoinConstraint, JoinOperator, Query,
9
- SelectItem, SetExpr, Statement, TableFactor, Visit, Visitor,
9
+ SelectItem, SetExpr, SetQuantifier, Statement, TableFactor, Visit, Visitor,
10
10
  };
11
11
  use std::{collections::HashSet, ops::ControlFlow};
12
12
 
@@ -23,7 +23,7 @@ pub(super) fn bound_projection(
23
23
  let Statement::Query(query) = crate::parser::parse_query(sql)? else {
24
24
  return Err(unsupported("requires a SELECT query"));
25
25
  };
26
- bind_query(catalog, &query)
26
+ bind_query(catalog, &query, &[], true)
27
27
  }
28
28
 
29
29
  fn unsupported(detail: &str) -> RewriteError {
@@ -40,7 +40,16 @@ fn unknown(kind: ErrorKind, detail: String) -> RewriteError {
40
40
  )
41
41
  }
42
42
 
43
- fn bind_query(catalog: &TableCatalog, query: &Query) -> Result<Vec<String>, RewriteError> {
43
+ // The last scope is the nearest enclosing SELECT. A derived table is bound
44
+ // independently unless LATERAL is explicitly supported.
45
+ type OuterScopes<'a> = [&'a [Relation]];
46
+
47
+ fn bind_query(
48
+ catalog: &TableCatalog,
49
+ query: &Query,
50
+ outer: &OuterScopes<'_>,
51
+ named_outputs: bool,
52
+ ) -> Result<Vec<String>, RewriteError> {
44
53
  if query.with.is_some()
45
54
  || !query.locks.is_empty()
46
55
  || query.for_clause.is_some()
@@ -50,16 +59,51 @@ fn bind_query(catalog: &TableCatalog, query: &Query) -> Result<Vec<String>, Rewr
50
59
  "does not yet support CTEs, locking, or dialect-specific query clauses",
51
60
  ));
52
61
  }
53
- let (relations, outputs) = match query.body.as_ref() {
62
+ let (relations, outputs) = bind_body(catalog, query.body.as_ref(), outer, named_outputs)?;
63
+ let output_names = outputs.iter().cloned().collect();
64
+ check(catalog, &query.order_by, &relations, outer, &output_names)?;
65
+ check(catalog, &query.limit, &relations, outer, &HashSet::new())?;
66
+ check(catalog, &query.limit_by, &relations, outer, &HashSet::new())?;
67
+ check(catalog, &query.offset, &relations, outer, &HashSet::new())?;
68
+ check(catalog, &query.fetch, &relations, outer, &HashSet::new())?;
69
+ Ok(outputs)
70
+ }
71
+
72
+ fn bind_body(
73
+ catalog: &TableCatalog,
74
+ body: &SetExpr,
75
+ outer: &OuterScopes<'_>,
76
+ named_outputs: bool,
77
+ ) -> Result<(Vec<Relation>, Vec<String>), RewriteError> {
78
+ match body {
54
79
  SetExpr::Query(inner) => {
55
- let outputs = bind_query(catalog, inner)?;
56
- (
57
- vec![Relation {
58
- columns: outputs.iter().cloned().collect(),
59
- ..Default::default()
60
- }],
61
- outputs,
62
- )
80
+ let outputs = bind_query(catalog, inner, outer, named_outputs)?;
81
+ Ok((Vec::new(), outputs))
82
+ }
83
+ SetExpr::SetOperation {
84
+ set_quantifier,
85
+ left,
86
+ right,
87
+ ..
88
+ } => {
89
+ if !matches!(
90
+ set_quantifier,
91
+ SetQuantifier::None | SetQuantifier::All | SetQuantifier::Distinct
92
+ ) {
93
+ return Err(unsupported(
94
+ "does not yet bind non-positional set operations",
95
+ ));
96
+ }
97
+ let (_, left) = bind_body(catalog, left, outer, named_outputs)?;
98
+ let (_, right) = bind_body(catalog, right, outer, false)?;
99
+ if left.len() != right.len() {
100
+ return Err(unsupported(
101
+ "requires equal projection widths in set operations",
102
+ ));
103
+ }
104
+ // Set result names come from the left arm. Arm relations are not
105
+ // visible to the compound query's ORDER BY or enclosing query.
106
+ Ok((Vec::new(), left))
63
107
  }
64
108
  SetExpr::Select(select) => {
65
109
  if select.into.is_some()
@@ -95,7 +139,7 @@ fn bind_query(catalog: &TableCatalog, query: &Query) -> Result<Vec<String>, Rewr
95
139
  // ON can see only the accumulated left side and this right side,
96
140
  // never a relation introduced by a later JOIN.
97
141
  if let Some(JoinConstraint::On(expr)) = constraint {
98
- check(expr, &relations, &HashSet::new())?;
142
+ check(catalog, expr, &relations, outer, &HashSet::new())?;
99
143
  }
100
144
  }
101
145
  }
@@ -104,7 +148,13 @@ fn bind_query(catalog: &TableCatalog, query: &Query) -> Result<Vec<String>, Rewr
104
148
  // an invalid forward reference and make an earlier valid name ambiguous.
105
149
  let mut final_expressions = select.as_ref().clone();
106
150
  final_expressions.from.clear();
107
- check(&final_expressions, &relations, &HashSet::new())?;
151
+ check(
152
+ catalog,
153
+ &final_expressions,
154
+ &relations,
155
+ outer,
156
+ &HashSet::new(),
157
+ )?;
108
158
  let mut outputs = Vec::new();
109
159
  for projection in &select.projection {
110
160
  let name = match projection {
@@ -113,6 +163,12 @@ fn bind_query(catalog: &TableCatalog, query: &Query) -> Result<Vec<String>, Rewr
113
163
  SelectItem::UnnamedExpr(Expr::CompoundIdentifier(parts)) => {
114
164
  parts.last().unwrap().value.clone()
115
165
  }
166
+ SelectItem::UnnamedExpr(_) if !named_outputs => {
167
+ // Expression subqueries need their dependencies and arity
168
+ // checked, but SELECT 1 in EXISTS exports no column name.
169
+ outputs.push(String::new());
170
+ continue;
171
+ }
116
172
  _ => {
117
173
  return Err(unsupported(
118
174
  "requires explicitly named projection expressions and does not expand wildcards",
@@ -120,25 +176,38 @@ fn bind_query(catalog: &TableCatalog, query: &Query) -> Result<Vec<String>, Rewr
120
176
  }
121
177
  };
122
178
  let name = ColumnName::new(name).key();
123
- if outputs.contains(&name) {
179
+ if named_outputs && outputs.contains(&name) {
124
180
  return Err(unsupported("requires unambiguous output column names"));
125
181
  }
126
182
  outputs.push(name);
127
183
  }
128
- (relations, outputs)
184
+ Ok((relations, outputs))
129
185
  }
130
- _ => return Err(unsupported("does not yet bind set operations or VALUES")),
131
- };
132
- let output_names = outputs.iter().cloned().collect();
133
- check(&query.order_by, &relations, &output_names)?;
134
- check(&query.limit, &relations, &HashSet::new())?;
135
- check(&query.limit_by, &relations, &HashSet::new())?;
136
- check(&query.offset, &relations, &HashSet::new())?;
137
- check(&query.fetch, &relations, &HashSet::new())?;
138
- Ok(outputs)
186
+ _ => Err(unsupported(
187
+ "does not yet bind this query body (including VALUES)",
188
+ )),
189
+ }
139
190
  }
140
191
 
141
192
  fn bind_table(catalog: &TableCatalog, factor: &TableFactor) -> Result<Relation, RewriteError> {
193
+ if let TableFactor::Derived {
194
+ lateral: false,
195
+ subquery,
196
+ alias: Some(alias),
197
+ } = factor
198
+ {
199
+ if !alias.columns.is_empty() {
200
+ return Err(unsupported(
201
+ "does not yet bind derived table column alias lists",
202
+ ));
203
+ }
204
+ let outputs = bind_query(catalog, subquery, &[], true)?;
205
+ return Ok(Relation {
206
+ qualifiers: HashSet::from([TableKey::new(&alias.name.value)]),
207
+ columns: outputs.into_iter().collect(),
208
+ });
209
+ }
210
+
142
211
  let TableFactor::Table {
143
212
  name,
144
213
  alias,
@@ -148,7 +217,7 @@ fn bind_table(catalog: &TableCatalog, factor: &TableFactor) -> Result<Relation,
148
217
  } = factor
149
218
  else {
150
219
  return Err(unsupported(
151
- "does not yet bind derived tables, table functions, or lateral/correlated scopes",
220
+ "does not yet bind unaliased derived tables, table functions, or LATERAL relations",
152
221
  ));
153
222
  };
154
223
  if args.is_some() || version.is_some() || alias.as_ref().is_some_and(|a| !a.columns.is_empty())
@@ -178,13 +247,18 @@ fn bind_table(catalog: &TableCatalog, factor: &TableFactor) -> Result<Relation,
178
247
  }
179
248
 
180
249
  fn check<T: Visit>(
250
+ catalog: &TableCatalog,
181
251
  node: &T,
182
252
  relations: &[Relation],
253
+ outer: &OuterScopes<'_>,
183
254
  outputs: &HashSet<String>,
184
255
  ) -> Result<(), RewriteError> {
185
256
  struct Binder<'a> {
257
+ catalog: &'a TableCatalog,
186
258
  relations: &'a [Relation],
259
+ outer: &'a OuterScopes<'a>,
187
260
  outputs: &'a HashSet<String>,
261
+ nested_queries: usize,
188
262
  }
189
263
  impl Binder<'_> {
190
264
  fn column(&self, qualifier: Option<TableKey>, column: &str) -> Result<(), RewriteError> {
@@ -192,14 +266,30 @@ fn check<T: Visit>(
192
266
  if qualifier.is_none() && self.outputs.contains(&key) {
193
267
  return Ok(());
194
268
  }
195
- let matching: Vec<_> = self
196
- .relations
197
- .iter()
198
- .filter(|r| qualifier.as_ref().is_none_or(|q| r.qualifiers.contains(q)))
199
- .collect();
200
- let count = matching.iter().filter(|r| r.columns.contains(&key)).count();
201
- if count == 1 {
202
- return Ok(());
269
+ let mut count = 0;
270
+ for scope in std::iter::once(self.relations).chain(self.outer.iter().rev().copied()) {
271
+ let mut qualifiers = 0;
272
+ for relation in scope {
273
+ if qualifier
274
+ .as_ref()
275
+ .is_none_or(|q| relation.qualifiers.contains(q))
276
+ {
277
+ qualifiers += 1;
278
+ count += usize::from(relation.columns.contains(&key));
279
+ }
280
+ }
281
+ // A local qualifier shadows an outer qualifier, even if the
282
+ // requested column is absent. Unqualified columns use the
283
+ // nearest scope with a matching column.
284
+ if count != 0 || (qualifier.is_some() && qualifiers != 0) {
285
+ if count == 1 && (qualifier.is_none() || qualifiers == 1) {
286
+ return Ok(());
287
+ }
288
+ if qualifiers > 1 && qualifier.is_some() {
289
+ count = qualifiers;
290
+ }
291
+ break;
292
+ }
203
293
  }
204
294
  Err(unknown(
205
295
  ErrorKind::UnknownColumn,
@@ -219,30 +309,42 @@ fn check<T: Visit>(
219
309
  }
220
310
  fn qualifier(&self, name: &sqlparser::ast::ObjectName) -> Result<(), RewriteError> {
221
311
  let key = TableKey::new(&name.to_string());
222
- if self
223
- .relations
224
- .iter()
225
- .filter(|r| r.qualifiers.contains(&key))
226
- .count()
227
- == 1
228
- {
229
- Ok(())
230
- } else {
231
- Err(unknown(
232
- ErrorKind::UnknownTable,
233
- format!("Dimension wildcard qualifier '{name}' is not bound unambiguously"),
234
- ))
312
+ for scope in std::iter::once(self.relations).chain(self.outer.iter().rev().copied()) {
313
+ match scope.iter().filter(|r| r.qualifiers.contains(&key)).count() {
314
+ 0 => continue,
315
+ 1 => return Ok(()),
316
+ _ => break,
317
+ }
235
318
  }
319
+ Err(unknown(
320
+ ErrorKind::UnknownTable,
321
+ format!("Dimension wildcard qualifier '{name}' is not bound unambiguously"),
322
+ ))
236
323
  }
237
324
  }
238
325
  impl Visitor for Binder<'_> {
239
326
  type Break = RewriteError;
240
- fn pre_visit_query(&mut self, _query: &Query) -> ControlFlow<Self::Break> {
241
- ControlFlow::Break(unsupported(
242
- "does not yet bind nested expression/correlated subqueries",
243
- ))
327
+ fn pre_visit_query(&mut self, query: &Query) -> ControlFlow<Self::Break> {
328
+ if self.nested_queries == 0 {
329
+ let mut visible = self.outer.to_vec();
330
+ visible.push(self.relations);
331
+ if let Err(error) = bind_query(self.catalog, query, &visible, false) {
332
+ return ControlFlow::Break(error);
333
+ }
334
+ }
335
+ // bind_query checks this subtree in its own scope. The generic
336
+ // visitor still traverses it; skip those duplicate visits here.
337
+ self.nested_queries += 1;
338
+ ControlFlow::Continue(())
339
+ }
340
+ fn post_visit_query(&mut self, _query: &Query) -> ControlFlow<Self::Break> {
341
+ self.nested_queries -= 1;
342
+ ControlFlow::Continue(())
244
343
  }
245
344
  fn pre_visit_expr(&mut self, expr: &Expr) -> ControlFlow<Self::Break> {
345
+ if self.nested_queries != 0 {
346
+ return ControlFlow::Continue(());
347
+ }
246
348
  let result = match expr {
247
349
  Expr::Identifier(ident) => self.column(None, &ident.value),
248
350
  Expr::CompoundIdentifier(parts) if parts.len() >= 2 => self.column(
@@ -281,7 +383,13 @@ fn check<T: Visit>(
281
383
  }
282
384
  }
283
385
  }
284
- match node.visit(&mut Binder { relations, outputs }) {
386
+ match node.visit(&mut Binder {
387
+ catalog,
388
+ relations,
389
+ outer,
390
+ outputs,
391
+ nested_queries: 0,
392
+ }) {
285
393
  ControlFlow::Continue(()) => Ok(()),
286
394
  ControlFlow::Break(error) => Err(error),
287
395
  }
@@ -321,6 +429,11 @@ mod tests {
321
429
  "SELECT u.id AS uid FROM s.users u JOIN roles r ON u.id=r.id WHERE r.enabled",
322
430
  "SELECT MAX(id) AS id FROM s.users HAVING MAX(id) > 0",
323
431
  "SELECT 1 AS id",
432
+ "SELECT id FROM s.users UNION SELECT id FROM roles",
433
+ "SELECT d.uid FROM (SELECT id AS uid FROM s.users UNION ALL SELECT id FROM roles) d",
434
+ "SELECT u.id FROM s.users u WHERE NOT EXISTS (SELECT 1 FROM roles r WHERE r.id=u.id)",
435
+ "SELECT u.id FROM s.users u WHERE EXISTS (SELECT 1 FROM roles r WHERE EXISTS (SELECT 1 FROM roles t WHERE t.id=r.id AND t.id=u.id))",
436
+ "SELECT u.id FROM s.users u WHERE EXISTS (SELECT 1 FROM roles r WHERE r.id = u.id AND EXISTS (SELECT 1 WHERE enabled))",
324
437
  "SELECT a.id AS id FROM s.users a JOIN roles b ON b.id=a.id JOIN s.users c ON c.id=b.id",
325
438
  "SELECT a.id AS id FROM s.users a JOIN roles b ON enabled JOIN roles c ON c.id=b.id",
326
439
  ] {
@@ -334,6 +447,14 @@ mod tests {
334
447
  "WITH d AS (SELECT id FROM ghost) SELECT id FROM d",
335
448
  "SELECT d.id FROM (SELECT id FROM ghost) d",
336
449
  "SELECT (SELECT ghost.id FROM ghost) AS id",
450
+ "SELECT id FROM s.users UNION SELECT missing FROM roles",
451
+ "SELECT id FROM s.users UNION SELECT id, enabled FROM roles",
452
+ "SELECT id FROM s.users UNION BY NAME SELECT id FROM roles",
453
+ "SELECT u.id FROM s.users u WHERE EXISTS (SELECT 1 FROM roles u WHERE u.\"display name\" IS NOT NULL)",
454
+ "SELECT u.id FROM s.users u WHERE EXISTS (SELECT 1 FROM roles r WHERE r.id = u.missing)",
455
+ "SELECT u.id FROM s.users u WHERE EXISTS (SELECT 1 FROM roles r WHERE EXISTS (SELECT 1 FROM ghost g WHERE g.id = r.id))",
456
+ "SELECT d.id FROM s.users u CROSS JOIN (SELECT u.id AS id) d",
457
+ "SELECT d.id FROM s.users u CROSS JOIN LATERAL (SELECT u.id AS id) d",
337
458
  "SELECT u.id FROM s.users u JOIN roles r USING (id)",
338
459
  ] {
339
460
  assert!(bound_projection(&c, sql).is_err(), "{sql}");
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "data-flow-control"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  description = "Rust-backed Data Flow Control rewrite engine"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]