pytrilogy 0.3.552__tar.gz → 0.3.554__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 (460) hide show
  1. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/PKG-INFO +1 -1
  2. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/__init__.py +1 -1
  3. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/constants.py +1 -1
  4. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/build.py +9 -0
  5. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/datasource.py +32 -9
  6. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/execute.py +27 -3
  7. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/join_resolution.py +47 -15
  8. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/base_node.py +30 -0
  9. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/merge_node.py +27 -0
  10. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/null_provenance.py +12 -2
  11. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/condition_injection.py +4 -1
  12. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/group_graph.py +13 -1
  13. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/join_plan.py +55 -19
  14. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/strategy_builder.py +162 -11
  15. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/datasource.py +58 -0
  16. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/base.py +4 -1
  17. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/duckdb.py +9 -5
  18. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/python_source.py +96 -0
  19. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/source_pushdown.py +161 -25
  20. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/click_support.py +12 -2
  21. pytrilogy-0.3.554/trilogy/io/contract.py +651 -0
  22. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/runner.py +62 -13
  23. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/vgi.py +14 -5
  24. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/render.py +16 -3
  25. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/trilogy.lark +1 -3
  26. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/datasource_rules.py +30 -34
  27. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/syntax.py +0 -2
  28. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_info_docs/content.py +4 -1
  29. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/Cargo.lock +1 -1
  30. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/Cargo.toml +1 -1
  31. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/parser.rs +3 -3
  32. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/trilogy.pest +1 -3
  33. pytrilogy-0.3.552/trilogy/io/contract.py +0 -346
  34. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/.scripts/__init__.py +0 -0
  35. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/.scripts/build_backend.py +0 -0
  36. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/.scripts/sync_version.py +0 -0
  37. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/LICENSE.md +0 -0
  38. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/README.md +0 -0
  39. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/pyproject.toml +0 -0
  40. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/README.md +0 -0
  41. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/__init__.py +0 -0
  42. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/conversation.py +0 -0
  43. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/enums.py +0 -0
  44. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/execute.py +0 -0
  45. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/models.py +0 -0
  46. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/prompts.py +0 -0
  47. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/__init__.py +0 -0
  48. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/anthropic.py +0 -0
  49. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/base.py +0 -0
  50. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/deepseek.py +0 -0
  51. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/google.py +0 -0
  52. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/openai.py +0 -0
  53. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/openrouter.py +0 -0
  54. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/providers/utils.py +0 -0
  55. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/ai/syntax_examples.py +0 -0
  56. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/authoring/README.md +0 -0
  57. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/authoring/__init__.py +0 -0
  58. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/constants.py +0 -0
  59. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/README.md +0 -0
  60. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/__init__.py +0 -0
  61. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/assertions.py +0 -0
  62. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/average_parts.py +0 -0
  63. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/casts.py +0 -0
  64. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/constants.py +0 -0
  65. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/domain_graph.py +0 -0
  66. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/domain_validation.py +0 -0
  67. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/enums.py +0 -0
  68. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/env_processor.py +0 -0
  69. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/environment_helpers.py +0 -0
  70. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/ergonomics.py +0 -0
  71. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/exceptions.py +0 -0
  72. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/fingerprint.py +0 -0
  73. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/functions.py +0 -0
  74. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/grain_pin.py +0 -0
  75. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/graph.py +0 -0
  76. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/graph_models.py +0 -0
  77. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/having_normalization.py +0 -0
  78. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/internal.py +0 -0
  79. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/like_patterns.py +0 -0
  80. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/__init__.py +0 -0
  81. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/author.py +0 -0
  82. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/build_environment.py +0 -0
  83. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/copying.py +0 -0
  84. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/core.py +0 -0
  85. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/environment.py +0 -0
  86. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/keyspace.py +0 -0
  87. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/models/reference_index.py +0 -0
  88. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimization.py +0 -0
  89. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/__init__.py +0 -0
  90. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/atom_contract.py +0 -0
  91. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/base_optimization.py +0 -0
  92. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/collapse_single_parent.py +0 -0
  93. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/existence_having_fold.py +0 -0
  94. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/filtered_aggregate.py +0 -0
  95. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/full_join_lowering.py +0 -0
  96. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/hide_unused_concept.py +0 -0
  97. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/identity_group.py +0 -0
  98. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/inline_datasource.py +0 -0
  99. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/join_hoist.py +0 -0
  100. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/merge_irrelevant_group_by.py +0 -0
  101. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/merge_twin_scans.py +0 -0
  102. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/null_safe_join.py +0 -0
  103. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/order_inner_joins.py +0 -0
  104. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
  105. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/preserved_join_keys.py +0 -0
  106. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/reuse_parent_lookup.py +0 -0
  107. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/semi_join_pushdown.py +0 -0
  108. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/strip_redundant_not_null.py +0 -0
  109. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/union_dim_pushdown.py +0 -0
  110. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/utils.py +0 -0
  111. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/optimizations/value_set_join_upgrade.py +0 -0
  112. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/README.md +0 -0
  113. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/__init__.py +0 -0
  114. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/aggregate_rollup.py +0 -0
  115. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/basic_graph.py +0 -0
  116. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/concept_strategies_v4.py +0 -0
  117. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/condition_utility.py +0 -0
  118. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/constants.py +0 -0
  119. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/consumer_proofs.py +0 -0
  120. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/discovery_utility.py +0 -0
  121. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/discovery_validation.py +0 -0
  122. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/grain_utility.py +0 -0
  123. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/join_key_groups.py +0 -0
  124. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/model_ambiguity.py +0 -0
  125. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/__init__.py +0 -0
  126. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/common.py +0 -0
  127. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/presence_probe.py +0 -0
  128. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
  129. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_helpers/condition_routing.py +0 -0
  130. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
  131. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_helpers/datasource_nodes.py +0 -0
  132. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_helpers/source_scoring.py +0 -0
  133. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
  134. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/node_generators/select_node.py +0 -0
  135. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/README.md +0 -0
  136. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/__init__.py +0 -0
  137. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/filter_node.py +0 -0
  138. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/group_node.py +0 -0
  139. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/recursive_node.py +0 -0
  140. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
  141. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/subselect_node.py +0 -0
  142. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/union_node.py +0 -0
  143. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/unnest_node.py +0 -0
  144. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/nodes/window_node.py +0 -0
  145. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/partial_bridging.py +0 -0
  146. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/plan_trace.py +0 -0
  147. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/plan_trace_model.py +0 -0
  148. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/relation_rollup.py +0 -0
  149. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/scan_partials.py +0 -0
  150. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/source_dominance.py +0 -0
  151. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/statement_scope.py +0 -0
  152. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/utility.py +0 -0
  153. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/__init__.py +0 -0
  154. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/concept_graph.py +0 -0
  155. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/condition_placement.py +0 -0
  156. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/constants.py +0 -0
  157. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/edges.py +0 -0
  158. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/extent_ownership.py +0 -0
  159. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/final_cover.py +0 -0
  160. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/functional_dependency.py +0 -0
  161. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/group_behaviors.py +0 -0
  162. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/group_rules.py +0 -0
  163. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/history.py +0 -0
  164. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/keyspace.py +0 -0
  165. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/models.py +0 -0
  166. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/network_build.py +0 -0
  167. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/network_coalescing.py +0 -0
  168. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/network_model.py +0 -0
  169. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/network_obligations.py +0 -0
  170. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/network_search.py +0 -0
  171. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/network_topology.py +0 -0
  172. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/projection.py +0 -0
  173. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/region_domains.py +0 -0
  174. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/region_reads.py +0 -0
  175. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/renders.py +0 -0
  176. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/root_partition.py +0 -0
  177. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/source_planning.py +0 -0
  178. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/staged_where.py +0 -0
  179. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_helper/union_arms.py +0 -0
  180. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/__init__.py +0 -0
  181. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/aggregate.py +0 -0
  182. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/basic.py +0 -0
  183. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/common.py +0 -0
  184. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/condition_sources.py +0 -0
  185. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/constant.py +0 -0
  186. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/dispatch.py +0 -0
  187. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/filter.py +0 -0
  188. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/group_to.py +0 -0
  189. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/multiselect.py +0 -0
  190. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/nested_select.py +0 -0
  191. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/recursive.py +0 -0
  192. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/rollup_select.py +0 -0
  193. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/root.py +0 -0
  194. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/rowset.py +0 -0
  195. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/rowset_witness.py +0 -0
  196. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/subselect.py +0 -0
  197. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/union.py +0 -0
  198. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/union_select.py +0 -0
  199. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/unnest.py +0 -0
  200. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/processing/v4_node_generators/window.py +0 -0
  201. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/query_processor.py +0 -0
  202. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/scope_diagnostics.py +0 -0
  203. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/statements/README.md +0 -0
  204. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/statements/__init__.py +0 -0
  205. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/statements/author.py +0 -0
  206. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/statements/build.py +0 -0
  207. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/statements/common.py +0 -0
  208. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/statements/execute.py +0 -0
  209. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/table_processor.py +0 -0
  210. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/union_find.py +0 -0
  211. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/utility.py +0 -0
  212. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/README.md +0 -0
  213. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/__init__.py +0 -0
  214. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/common.py +0 -0
  215. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/concept.py +0 -0
  216. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/environment.py +0 -0
  217. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/fix.py +0 -0
  218. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/validation/rows.py +0 -0
  219. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/core/where_scope_normalization.py +0 -0
  220. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/__init__.py +0 -0
  221. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/bigquery.py +0 -0
  222. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/bigquery_engine.py +0 -0
  223. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/bigquery_persist.py +0 -0
  224. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/bigquery_staging.py +0 -0
  225. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/cancel.py +0 -0
  226. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/clickhouse.py +0 -0
  227. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/clickhouse_chdb.py +0 -0
  228. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/common.py +0 -0
  229. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/config.py +0 -0
  230. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/databricks.py +0 -0
  231. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/dataframe.py +0 -0
  232. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/duckdb_pool.py +0 -0
  233. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/duckdb_uv.py +0 -0
  234. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/duckdb_vgi.py +0 -0
  235. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/enums.py +0 -0
  236. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/haybarn_engine.py +0 -0
  237. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/join_barriers.py +0 -0
  238. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/metadata.py +0 -0
  239. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/mock.py +0 -0
  240. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/mock_pattern.py +0 -0
  241. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/mysql.py +0 -0
  242. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/postgres.py +0 -0
  243. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/presto.py +0 -0
  244. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/results.py +0 -0
  245. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/snowflake.py +0 -0
  246. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/sql_server.py +0 -0
  247. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/sqlite.py +0 -0
  248. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/dialect/table_function.py +0 -0
  249. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/engine.py +0 -0
  250. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/__init__.py +0 -0
  251. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/assertions.py +0 -0
  252. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/client_copy.py +0 -0
  253. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/config.py +0 -0
  254. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/envs.py +0 -0
  255. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/model_fingerprint.py +0 -0
  256. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/outputs.py +0 -0
  257. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/report.py +0 -0
  258. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/staged_write.py +0 -0
  259. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/AGENTS.md +0 -0
  260. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/CLAUDE.md +0 -0
  261. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/__init__.py +0 -0
  262. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/cache.py +0 -0
  263. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/declaration.py +0 -0
  264. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/exceptions.py +0 -0
  265. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/isolation.py +0 -0
  266. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/partitions.py +0 -0
  267. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/persistence.py +0 -0
  268. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/phases.py +0 -0
  269. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/snapshot.py +0 -0
  270. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/state_store.py +0 -0
  271. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/state/watermarks.py +0 -0
  272. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/execution/write_order.py +0 -0
  273. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/executor.py +0 -0
  274. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/hooks/__init__.py +0 -0
  275. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/hooks/base_hook.py +0 -0
  276. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/hooks/graph_hook.py +0 -0
  277. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/hooks/query_debugger.py +0 -0
  278. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/__init__.py +0 -0
  279. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/adapters.py +0 -0
  280. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/arrow.py +0 -0
  281. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/describe.py +0 -0
  282. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/errors.py +0 -0
  283. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/io/sinks.py +0 -0
  284. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/metadata/__init__.py +0 -0
  285. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parser.py +0 -0
  286. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/README.md +0 -0
  287. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/__init__.py +0 -0
  288. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/common.py +0 -0
  289. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/exceptions.py +0 -0
  290. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/helpers.py +0 -0
  291. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/parse_engine_v2.py +0 -0
  292. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/pretty.py +0 -0
  293. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/README.md +0 -0
  294. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/__init__.py +0 -0
  295. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/concept_syntax.py +0 -0
  296. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/errors.py +0 -0
  297. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/function_syntax.py +0 -0
  298. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/hydration.py +0 -0
  299. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/import_service.py +0 -0
  300. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/lark_backend.py +0 -0
  301. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/model.py +0 -0
  302. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/pest_backend.py +0 -0
  303. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rowset_semantics.py +0 -0
  304. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/__init__.py +0 -0
  305. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/chart_rules.py +0 -0
  306. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/concept_rules.py +0 -0
  307. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/conditional_rules.py +0 -0
  308. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/expression_rules.py +0 -0
  309. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/function_definition_rules.py +0 -0
  310. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/function_rules.py +0 -0
  311. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/import_rules.py +0 -0
  312. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/merge_rules.py +0 -0
  313. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/multiselect_rules.py +0 -0
  314. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/operational_rules.py +0 -0
  315. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/order_rules.py +0 -0
  316. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/persist_rules.py +0 -0
  317. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/rawsql_rules.py +0 -0
  318. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/rollup_lift.py +0 -0
  319. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/rowset_rules.py +0 -0
  320. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/select_rules.py +0 -0
  321. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/select_statement_rules.py +0 -0
  322. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/statement_rules.py +0 -0
  323. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/subselect_rules.py +0 -0
  324. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/token_rules.py +0 -0
  325. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/tvf_rules.py +0 -0
  326. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules/type_rules.py +0 -0
  327. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/rules_context.py +0 -0
  328. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/select_finalize.py +0 -0
  329. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/semantic_scope.py +0 -0
  330. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/semantic_state.py +0 -0
  331. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/statement_planner.py +0 -0
  332. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/statement_plans.py +0 -0
  333. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/parsing/v2/symbols.py +0 -0
  334. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/py.typed +0 -0
  335. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/render.py +0 -0
  336. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/__init__.py +0 -0
  337. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/altair_renderer.py +0 -0
  338. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/base.py +0 -0
  339. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/chart_theme.py +0 -0
  340. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/rich_types.py +0 -0
  341. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/terminal_renderer.py +0 -0
  342. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/rendering/theme.py +0 -0
  343. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/__init__.py +0 -0
  344. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/backends/__init__.py +0 -0
  345. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/backends/base.py +0 -0
  346. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/backends/html.py +0 -0
  347. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/backends/png.py +0 -0
  348. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/charts.py +0 -0
  349. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/document.py +0 -0
  350. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/runner.py +0 -0
  351. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/report/tables.py +0 -0
  352. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/AGENTS.md +0 -0
  353. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/CLAUDE.md +0 -0
  354. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/README.md +0 -0
  355. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/__init__.py +0 -0
  356. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent.py +0 -0
  357. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_info.py +0 -0
  358. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_info_docs/__init__.py +0 -0
  359. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_info_docs/cli.py +0 -0
  360. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_info_docs/directory.py +0 -0
  361. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_render.py +0 -0
  362. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_sessions.py +0 -0
  363. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_sql_tools.py +0 -0
  364. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/agent_tools.py +0 -0
  365. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/click_utils.py +0 -0
  366. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/cloud.py +0 -0
  367. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/cloud_models.py +0 -0
  368. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/common.py +0 -0
  369. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/database.py +0 -0
  370. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/README.md +0 -0
  371. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/build.sh +0 -0
  372. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/examples/basic_usage.rs +0 -0
  373. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/directory_resolver.rs +0 -0
  374. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/graph.rs +0 -0
  375. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/lib.rs +0 -0
  376. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/main.rs +0 -0
  377. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/network_search.rs +0 -0
  378. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/python_bindings.rs +0 -0
  379. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/resolver.rs +0 -0
  380. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/src/trilogy_parser.rs +0 -0
  381. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/base.preql +0 -0
  382. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/cli_integration.rs +0 -0
  383. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/customer.preql +0 -0
  384. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/main.preql +0 -0
  385. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/nesting_limit.rs +0 -0
  386. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/orders.preql +0 -0
  387. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/parse_cost.rs +0 -0
  388. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/public_api.rs +0 -0
  389. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/test_data/base.preql +0 -0
  390. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency/tests/test_data/consumer.preql +0 -0
  391. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/dependency.py +0 -0
  392. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display.py +0 -0
  393. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_core.py +0 -0
  394. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_execution.py +0 -0
  395. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_ingest.py +0 -0
  396. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_init.py +0 -0
  397. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_models.py +0 -0
  398. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_parallel.py +0 -0
  399. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_refresh.py +0 -0
  400. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/display_validation.py +0 -0
  401. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/env_commands.py +0 -0
  402. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/environment.py +0 -0
  403. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/explore.py +0 -0
  404. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/explore_seen.py +0 -0
  405. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/file.py +0 -0
  406. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/file_helpers/__init__.py +0 -0
  407. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/file_helpers/backends.py +0 -0
  408. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/file_helpers/preql_description.py +0 -0
  409. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/file_helpers/preql_validation.py +0 -0
  410. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/fmt.py +0 -0
  411. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest.py +0 -0
  412. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest_helpers/__init__.py +0 -0
  413. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest_helpers/fk_inference.py +0 -0
  414. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest_helpers/foreign_keys.py +0 -0
  415. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest_helpers/formatting.py +0 -0
  416. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest_helpers/introspection.py +0 -0
  417. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/ingest_helpers/typing.py +0 -0
  418. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/init.py +0 -0
  419. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/parallel_execution.py +0 -0
  420. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/plan.py +0 -0
  421. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/project_config.py +0 -0
  422. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/public.py +0 -0
  423. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/refresh.py +0 -0
  424. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/render.py +0 -0
  425. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/run.py +0 -0
  426. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve.py +0 -0
  427. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/__init__.py +0 -0
  428. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/connection_spec.py +0 -0
  429. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/file_discovery.py +0 -0
  430. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/index_generation.py +0 -0
  431. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/jobs.py +0 -0
  432. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/mcp_server.py +0 -0
  433. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/models.py +0 -0
  434. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/state_cache.py +0 -0
  435. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/state_computation.py +0 -0
  436. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/serve_helpers/studio_bundle.py +0 -0
  437. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/single_execution.py +0 -0
  438. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/source.py +0 -0
  439. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/source_identity.py +0 -0
  440. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/state.py +0 -0
  441. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/testing.py +0 -0
  442. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/trilogy.py +0 -0
  443. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/scripts/validate_agent.py +0 -0
  444. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/staging.py +0 -0
  445. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/__init__.py +0 -0
  446. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/bytes.preql +0 -0
  447. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/chart.preql +0 -0
  448. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/collection.preql +0 -0
  449. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/color.preql +0 -0
  450. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/currency.preql +0 -0
  451. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/date.preql +0 -0
  452. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/display.preql +0 -0
  453. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/geography.preql +0 -0
  454. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/metric.preql +0 -0
  455. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/money.preql +0 -0
  456. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/net.preql +0 -0
  457. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/ranking.preql +0 -0
  458. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/report.preql +0 -0
  459. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/std/semantic.preql +0 -0
  460. {pytrilogy-0.3.552 → pytrilogy-0.3.554}/trilogy/utility.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytrilogy
3
- Version: 0.3.552
3
+ Version: 0.3.554
4
4
  Classifier: Programming Language :: Python
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.11
@@ -7,7 +7,7 @@ if TYPE_CHECKING:
7
7
  from trilogy.executor import Executor
8
8
  from trilogy.parser import parse
9
9
 
10
- __version__ = "0.3.552"
10
+ __version__ = "0.3.554"
11
11
 
12
12
  __all__ = [
13
13
  "CONFIG",
@@ -105,7 +105,7 @@ Default to windows for self-referential queries (period-over-period, running tot
105
105
 
106
106
  Scalars: `string`, `bytes`, `bool`, `int`, `bigint`, `float`, `double`, `number`, `numeric(p,s)` (alias `decimal`; use for exact money), `date`, `datetime`, `timestamp`, `geography`, `any`. Composites: `array<T>`, `map<K, V>`, `struct<name: T, ...>`, `enum<T>[v1, v2, ...]`. Cast with `::type` or `cast(x as type)`: `"2020-01-01"::date`.
107
107
 
108
- `?` after a type marks it nullable (`property user.middle_name string?;`). `~` prefixing a concept marks the reference as a PARTIAL subset of the concept's domain — on a select item (`~customer.id`) or in `merge a into ~b` (a ⊆ b); it tells the planner this side is not authoritative.
108
+ `?` after a type marks it nullable (`property user.middle_name string?;`): the concept may then be NULL in every datasource that binds it. `?` on a datasource column (`customer_id: ?customer.id`) only says some of that table's rows have no value; it does not make the concept nullable. `~` prefixing a concept marks the reference as a PARTIAL subset of the concept's domain — on a select item (`~customer.id`) or in `merge a into ~b` (a ⊆ b); it tells the planner this side is not authoritative.
109
109
 
110
110
  ## Expression gotchas
111
111
 
@@ -2229,6 +2229,10 @@ class BuildColumnAssignment:
2229
2229
  # which relation endpoint each side physically carries. None = no
2230
2230
  # substitution; the concept's own address is its origin.
2231
2231
  origin_address: str | None = None
2232
+ # The binding itself says `?`: some of this table's rows name no member.
2233
+ # A column nullable only because its concept declares NULL holds a member
2234
+ # on every row.
2235
+ optional: bool = False
2232
2236
 
2233
2237
  @property
2234
2238
  def is_complete(self) -> bool:
@@ -2354,6 +2358,10 @@ class BuildDatasource:
2354
2358
  def nullable_concepts(self) -> list[BuildConcept]:
2355
2359
  return [c.concept for c in self.columns if Modifier.NULLABLE in c.modifiers]
2356
2360
 
2361
+ @property
2362
+ def optional_concepts(self) -> list[BuildConcept]:
2363
+ return [c.concept for c in self.columns if c.optional]
2364
+
2357
2365
  @property
2358
2366
  def hidden_concepts(self) -> list[BuildConcept]:
2359
2367
  return [c.concept for c in self.columns if Modifier.HIDDEN in c.modifiers]
@@ -4138,6 +4146,7 @@ class Factory:
4138
4146
  ),
4139
4147
  concept=fetched,
4140
4148
  modifiers=modifiers,
4149
+ optional=Modifier.NULLABLE in base.modifiers,
4141
4150
  # a scoped join/merge substituted this binding onto the relation's
4142
4151
  # canonical address — thread the authored origin forward so
4143
4152
  # same-address join-pair rulings can tell the sides apart.
@@ -1,5 +1,6 @@
1
1
  import copy
2
2
  import glob as glob_module
3
+ import shlex
3
4
  from collections.abc import ItemsView, ValuesView
4
5
  from dataclasses import dataclass, field
5
6
  from datetime import date, datetime, timedelta
@@ -197,8 +198,8 @@ class AddressArgument:
197
198
  name: str | None = None
198
199
 
199
200
 
200
- # Splits a program's static arguments off its path in ``safe_address``. ``|`` is
201
- # rejected in arguments and illegal in Windows file names.
201
+ # Splits a program's static arguments off its path in ``safe_address``. No
202
+ # argument token contains ``|`` (it is encoded), and Windows file names cannot.
202
203
  SCRIPT_ARGS_SEPARATOR = " | "
203
204
 
204
205
 
@@ -223,9 +224,9 @@ class Address:
223
224
  # The source a multi-source program serves (``file `x.py#name```), passed
224
225
  # to it as ``--source name``.
225
226
  source_name: str | None = None
226
- # Static arguments a program is run with (``file `x.py` args ('a')``),
227
+ # Static arguments a program is run with (``file `x.py`('a', k := 1)``),
227
228
  # ahead of ``--source`` and pushed-down filters.
228
- script_args: list[str | int | float] = field(default_factory=list)
229
+ script_args: list[AddressArgument] = field(default_factory=list)
229
230
  # Set for a table-function address (``address fn(col, k := 'v')``).
230
231
  arguments: list[AddressArgument] | None = None
231
232
 
@@ -237,11 +238,31 @@ class Address:
237
238
  def bound_columns(self) -> list[str]:
238
239
  return [str(a.value) for a in self.arguments or [] if a.bound]
239
240
 
241
+ @staticmethod
242
+ def argument_token(value: str | float | bool) -> str:
243
+ if isinstance(value, bool):
244
+ return "true" if value else "false"
245
+ return str(value)
246
+
240
247
  @property
241
248
  def static_args(self) -> tuple[str, ...]:
242
- """``script_args`` as command-line tokens. Parsing admits only values
243
- that need no quoting (``source_pushdown.is_transport_safe``)."""
244
- return tuple(str(a) for a in self.script_args)
249
+ """``script_args`` as the strings the program receives, a named one as
250
+ ``--name value``. Also the source's identity, whatever carries them."""
251
+ tokens: list[str] = []
252
+ for arg in self.script_args:
253
+ if arg.name:
254
+ tokens.append(f"--{arg.name}")
255
+ tokens.append(self.argument_token(arg.value))
256
+ return tuple(tokens)
257
+
258
+ @property
259
+ def static_arg_tokens(self) -> tuple[str, ...]:
260
+ """``static_args`` on the command line: in one ``--request`` for a
261
+ source that reads it, else plain."""
262
+ from trilogy.dialect.source_pushdown import static_arg_tokens
263
+
264
+ values = [self.argument_token(a.value) for a in self.script_args]
265
+ return static_arg_tokens(self.static_args, values, self.location)
245
266
 
246
267
  @property
247
268
  def source_selector(self) -> str:
@@ -251,7 +272,7 @@ class Address:
251
272
  @property
252
273
  def source_args(self) -> str:
253
274
  """The command line this address runs its program with."""
254
- return " ".join(filter(None, [*self.static_args, self.source_selector]))
275
+ return " ".join(filter(None, [*self.static_arg_tokens, self.source_selector]))
255
276
 
256
277
  @property
257
278
  def is_query(self):
@@ -598,7 +619,9 @@ class Datasource(HasUUID, Namespaced):
598
619
  if self.address.source_name:
599
620
  address = f"{address}#{self.address.source_name}"
600
621
  if self.address.script_args:
601
- args = " ".join(self.address.static_args)
622
+ # Quoted, so ('a b') and ('a', 'b') differ; plain either way, so
623
+ # the asset is the same whether its args travel encoded or not.
624
+ args = shlex.join(self.address.static_args)
602
625
  address = f"{address}{SCRIPT_ARGS_SEPARATOR}{args}"
603
626
  return address
604
627
  return self.address
@@ -1700,6 +1700,32 @@ class Join(Generic[NodeT]):
1700
1700
  return alias
1701
1701
 
1702
1702
 
1703
+ def _reads_as_row(source: QueryDatasource, key: str) -> bool:
1704
+ return any(
1705
+ c.address == key for c in (*source.output_concepts, *source.input_concepts)
1706
+ )
1707
+
1708
+
1709
+ def _merged_sources(
1710
+ a: QueryDatasource, b: QueryDatasource, key: str
1711
+ ) -> set[BuildDatasource | QueryDatasource | UnnestJoin]:
1712
+ """Both sides' sources for `key`. Where one side reads it as a row value
1713
+ and the other only by subselect (`count(x ? c)` beside `y ? id in (x ?
1714
+ c)`), the subselect's feeder is no column of the merged rows
1715
+ (`Filters.set_read_as_row_is_computed_on_the_row`)."""
1716
+ found = [a.source_map.get(key, set()), b.source_map.get(key, set())]
1717
+ if _reads_as_row(a, key) != _reads_as_row(b, key):
1718
+ found = [
1719
+ (
1720
+ sources
1721
+ if _reads_as_row(side, key)
1722
+ else sources - side.existence_source_map.get(key, set())
1723
+ )
1724
+ for side, sources in zip((a, b), found)
1725
+ ]
1726
+ return found[0] | found[1]
1727
+
1728
+
1703
1729
  @dataclass
1704
1730
  class QueryDatasource:
1705
1731
  input_concepts: UniqueList[BuildConcept]
@@ -1999,9 +2025,7 @@ class QueryDatasource:
1999
2025
 
2000
2026
  # add our sources
2001
2027
  for key in self.source_map:
2002
- final_source_map[key] = self.source_map[key].union(
2003
- other.source_map.get(key, set())
2004
- )
2028
+ final_source_map[key] = _merged_sources(self, other, key)
2005
2029
  # add their sources
2006
2030
  for key in other.source_map:
2007
2031
  if key not in final_source_map:
@@ -408,6 +408,9 @@ class JoinFacts:
408
408
  # two sides -> the keys the join plan pairs them on, each a column both
409
409
  # hold; a pair it does not name pairs on nothing
410
410
  pair_keys: Mapping[frozenset[str], frozenset[str]] = field(default_factory=dict)
411
+ # two sides -> the columns of what the plan pairs them on that only one of
412
+ # them holds: met on the rest, the pairing waits for a side holding them
413
+ pair_gaps: Mapping[frozenset[str], frozenset[str]] = field(default_factory=dict)
411
414
  # each side's place in the one order the walk joins the merge's sides in
412
415
  # (`_stated_order`)
413
416
  side_ranks: Mapping[str, int] = field(default_factory=dict)
@@ -546,13 +549,16 @@ class JoinFacts:
546
549
 
547
550
  def whole(self, side: str, walked: Collection[str]) -> bool:
548
551
  """`side` joins the tree holding `walked` on all that relates them:
549
- every key a chord pairing (`chords`) leaves out is held by a walked
550
- side it pairs with in the same join. Met on the chord alone, an
552
+ every key a chord pairing (`chords`) leaves out, and every planned
553
+ key one of the two lacks (`pair_gaps`), is held by a walked side it
554
+ pairs with in the same join. Met on the chord alone, an
551
555
  outer join keeps the rows the missing key would have told apart."""
552
556
  lefts = [left for left in walked if self.walked_pair(side, left, walked)]
553
557
  held = frozenset().union(*(self.side(left).columns for left in lefts))
554
558
  return all(
555
- self.chords.get(frozenset({side, left}), frozenset()) <= held
559
+ self.chords.get(frozenset({side, left}), frozenset())
560
+ | self.pair_gaps.get(frozenset({side, left}), frozenset())
561
+ <= held
556
562
  for left in lefts
557
563
  )
558
564
 
@@ -811,7 +817,10 @@ def _partial_domain_join(
811
817
  right_is_dim = bool(right_facts.grain) and right_facts.grain <= keys
812
818
  if left_is_dim != right_is_dim:
813
819
  fact = right_facts if left_is_dim else left_facts
814
- if not keys & fact.value_nullables or partial_keys <= facts.unextended_keys:
820
+ if (
821
+ not keys & fact.extent_nullables
822
+ or partial_keys <= facts.unextended_keys
823
+ ):
815
824
  return _preserving(right_is_dim)
816
825
  return JoinType.FULL
817
826
 
@@ -878,9 +887,14 @@ def _nullable_join(
878
887
  ) and not facts.authored(keys):
879
888
  return _preserving(left_value)
880
889
  # Off a declared relation, whether each of two sides reading other
881
- # rows holds a value NULL group is data: keep both.
890
+ # rows holds rows naming no member (a `?` binding) is data: keep both.
891
+ # A NULL the concept declares is a member like any other, which a
892
+ # complete binding holds: that pairing stays INNER.
882
893
  if (
883
894
  left_value
895
+ and bool(
896
+ keys & (left_facts.extent_nullables | right_facts.extent_nullables)
897
+ )
884
898
  and not facts.authored(keys)
885
899
  and _null_groups_unanchored(keys, left_facts, right_facts)
886
900
  ):
@@ -3206,27 +3220,44 @@ def _planned_pair_nodes(
3206
3220
  columns: Mapping[str, frozenset[str]],
3207
3221
  planned_pairs: Mapping[frozenset[str], frozenset[str]],
3208
3222
  environment: BuildEnvironment,
3209
- ) -> dict[frozenset[str], frozenset[str]]:
3223
+ ) -> tuple[dict[frozenset[str], frozenset[str]], dict[frozenset[str], frozenset[str]]]:
3210
3224
  """`planned_pairs` (datasource identifiers -> addresses) in the merge's
3211
3225
  spelling: a pair's keys are the columns both sides hold of the classes the
3212
- plan pairs them on."""
3226
+ plan pairs them on; its gaps, those only one side holds, the keys do not
3227
+ determine and a third side holds."""
3213
3228
  held = frozenset().union(*columns.values())
3214
3229
  roots = environment.address_roots(
3215
3230
  {node.removeprefix("c~") for node in held}
3216
3231
  | frozenset().union(*planned_pairs.values())
3217
3232
  )
3218
3233
  out: dict[frozenset[str], frozenset[str]] = {}
3234
+ gaps: dict[frozenset[str], frozenset[str]] = {}
3219
3235
  for pair, keys in planned_pairs.items():
3220
3236
  planned = {roots.get(address, address) for address in keys}
3221
- both = frozenset.intersection(
3222
- *(columns.get(f"ds~{identifier}", frozenset()) for identifier in pair)
3237
+ sides = [columns.get(f"ds~{identifier}", frozenset()) for identifier in pair]
3238
+ nodes = frozenset(f"ds~{identifier}" for identifier in pair)
3239
+ both = frozenset.intersection(*sides)
3240
+ either = frozenset().union(*sides)
3241
+ out[nodes], gap = (
3242
+ frozenset(
3243
+ node
3244
+ for node in group
3245
+ if roots.get(node.removeprefix("c~"), node.removeprefix("c~"))
3246
+ in planned
3247
+ )
3248
+ for group in (both, either - both)
3223
3249
  )
3224
- out[frozenset(f"ds~{identifier}" for identifier in pair)] = frozenset(
3225
- node
3226
- for node in both
3227
- if roots.get(node.removeprefix("c~"), node.removeprefix("c~")) in planned
3250
+ determined = _fd_closure(
3251
+ environment, [node.removeprefix("c~") for node in out[nodes]]
3228
3252
  )
3229
- return out
3253
+ # only a third side holding the key can close the gap
3254
+ others = frozenset().union(
3255
+ *(cols for side, cols in columns.items() if side not in nodes)
3256
+ )
3257
+ gaps[nodes] = frozenset(
3258
+ node for node in gap & others if node.removeprefix("c~") not in determined
3259
+ )
3260
+ return out, gaps
3230
3261
 
3231
3262
 
3232
3263
  def _pair_modifiers(
@@ -4389,7 +4420,7 @@ def get_node_joins(
4389
4420
  for node, concept in spelled.items():
4390
4421
  ds_concept_map.setdefault((ds_node, node), concept)
4391
4422
 
4392
- pair_nodes = _planned_pair_nodes(
4423
+ pair_nodes, pair_gaps = _planned_pair_nodes(
4393
4424
  {node: side.columns for node, side in sides.items()}, planned_pairs, environment
4394
4425
  )
4395
4426
 
@@ -4491,6 +4522,7 @@ def get_node_joins(
4491
4522
  unextended_keys=frozenset(canon_node(a) for a in unextended_spans),
4492
4523
  span_families=span_families,
4493
4524
  pair_keys=pair_nodes,
4525
+ pair_gaps=pair_gaps,
4494
4526
  seed=f"ds~{seed}" if seed else None,
4495
4527
  applied=tuple(applied),
4496
4528
  consumer_applied=tuple(consumer_applied),
@@ -152,6 +152,30 @@ def resolve_existence_map(
152
152
  }
153
153
 
154
154
 
155
+ def _row_reads_skip_set_feeders(
156
+ source_map: dict[str, set[BuildDatasource | QueryDatasource | UnnestJoin]],
157
+ inputs: list[QueryDatasource | BuildDatasource],
158
+ existence_concepts: list[BuildConcept],
159
+ row_concepts: list[BuildConcept],
160
+ ) -> None:
161
+ """A set also read as a row value (`count(x ? c)` beside `y ? id in (x ?
162
+ c)`) is computed on the row: its feeder is a subselect, not a column the
163
+ FROM holds."""
164
+ existence = {c.address for c in existence_concepts}
165
+ if not existence:
166
+ return
167
+ feeders = {
168
+ id(s) for s in inputs if {c.address for c in s.output_concepts} <= existence
169
+ }
170
+ for concept in row_concepts:
171
+ sources = source_map.get(concept.address)
172
+ if concept.address not in existence or not sources:
173
+ continue
174
+ kept = {s for s in sources if id(s) not in feeders}
175
+ if len(kept) < len(sources):
176
+ source_map[concept.address] = kept
177
+
178
+
155
179
  def _partial_via_subset_member(
156
180
  c: BuildConcept,
157
181
  parents: list["StrategyNode"],
@@ -641,6 +665,12 @@ class StrategyNode:
641
665
  targets=self.output_concepts,
642
666
  inherited_inputs=self.input_concepts + self.existence_concepts,
643
667
  )
668
+ _row_reads_skip_set_feeders(
669
+ source_map,
670
+ parent_sources,
671
+ self.existence_concepts,
672
+ self.input_concepts + self.output_concepts,
673
+ )
644
674
 
645
675
  # Nullability is recomputed from the RESOLVED parents rather than the
646
676
  # construction-time snapshot: the parent NODE attribute only carries
@@ -375,6 +375,22 @@ def _cap_lookup_joins(
375
375
  join.join_type = JoinType.LEFT_OUTER
376
376
 
377
377
 
378
+ def _cap_gate_joins(
379
+ joins: list[SourceJoin | UnnestJoin], gates: Collection[str]
380
+ ) -> None:
381
+ """A WHERE aggregate's own group read beside the statement's rows keeps no
382
+ row of its own: its groups are every row's, never the rows the WHERE kept,
383
+ and a restated gate that holds on NULL passes its padding
384
+ (`Filters.gate_group_keeps_no_row`)."""
385
+ for join in joins:
386
+ if not isinstance(join, Join) or join.right.identifier not in gates:
387
+ continue
388
+ if join.join_type == JoinType.RIGHT_OUTER:
389
+ join.join_type = JoinType.INNER
390
+ elif join.join_type == JoinType.FULL:
391
+ join.join_type = JoinType.LEFT_OUTER
392
+
393
+
378
394
  def _resolve_node(node: StrategyNode) -> BuildDatasource | QueryDatasource:
379
395
  return node.resolve()
380
396
 
@@ -407,6 +423,7 @@ class MergeNode(StrategyNode):
407
423
  span_scope: SpanScope | None = None,
408
424
  planned_pairs: PlannedPairs | None = None,
409
425
  lookups: frozenset[int] = frozenset(),
426
+ gates: frozenset[int] = frozenset(),
410
427
  ):
411
428
  super().__init__(
412
429
  input_concepts=input_concepts,
@@ -447,6 +464,8 @@ class MergeNode(StrategyNode):
447
464
  # parents (by id) that only supply values to rows the others hold (a
448
465
  # WHERE's argument): a join never preserves a row of theirs
449
466
  self.lookups = lookups
467
+ # parents (by id) holding only a WHERE aggregate's own groups
468
+ self.gates = gates
450
469
  # what every consumer's filter rejects (`consumer_proofs`): narrows
451
470
  # the joins like this node's own WHERE, never rendered here. The rows
452
471
  # it drops are rows every consumer drops, so an address the merge
@@ -950,12 +969,15 @@ class MergeNode(StrategyNode):
950
969
  )
951
970
  lookup_keys: set[str] = set()
952
971
  row_keys: set[str] = set()
972
+ gate_keys: set[str] = set()
953
973
  for parent, source in zip(self.parents, parent_sources):
954
974
  elsewhere = _supplied_elsewhere(source, parent_sources)
955
975
  key = source.identifier
956
976
  if isinstance(source, QueryDatasource) and key not in merged:
957
977
  key = by_shape.setdefault(source.shape, key)
958
978
  (lookup_keys if id(parent) in self.lookups else row_keys).add(key)
979
+ if id(parent) in self.gates:
980
+ gate_keys.add(key)
959
981
  held[key] = _held_groups(
960
982
  held.get(key, frozenset()),
961
983
  parent,
@@ -1091,6 +1113,7 @@ class MergeNode(StrategyNode):
1091
1113
  f"{self.logging_prefix}{LOGGER_PREFIX} Final join count for CTE parent count {len(join_candidates)} is {len(joins)}"
1092
1114
  )
1093
1115
  _cap_lookup_joins(joins, lookup_keys - row_keys)
1116
+ _cap_gate_joins(joins, gate_keys - {k for k in row_keys if k not in gate_keys})
1094
1117
  if self.planned_join_types is not None:
1095
1118
  keep_planned_join_types(
1096
1119
  joins,
@@ -1351,6 +1374,9 @@ class MergeNode(StrategyNode):
1351
1374
  self.lookups = frozenset(
1352
1375
  id(swap[key]) if key in swap else key for key in self.lookups
1353
1376
  )
1377
+ self.gates = frozenset(
1378
+ id(swap[key]) if key in swap else key for key in self.gates
1379
+ )
1354
1380
 
1355
1381
  def copy(self) -> "MergeNode":
1356
1382
  node = type(self)(
@@ -1377,5 +1403,6 @@ class MergeNode(StrategyNode):
1377
1403
  span_scope=self.span_scope,
1378
1404
  planned_pairs=self.planned_pairs,
1379
1405
  lookups=self.lookups,
1406
+ gates=self.gates,
1380
1407
  )
1381
1408
  return self.with_marks(node)
@@ -28,7 +28,6 @@ from trilogy.core.processing.utility import (
28
28
  PADS_RIGHT_JOIN_TYPES,
29
29
  joined_right_ids,
30
30
  left_deep_joins,
31
- nullable_addresses_with_pseudonyms,
32
31
  )
33
32
 
34
33
  DataSource = QueryDatasource | BuildDatasource
@@ -90,7 +89,7 @@ class NullProvenance:
90
89
  self._extent = frozenset()
91
90
  self._extent = _padded_addresses(
92
91
  self.source,
93
- nullable_addresses_with_pseudonyms,
92
+ _optional_leaf_addresses,
94
93
  self.driven,
95
94
  lambda p: p.extent,
96
95
  )
@@ -184,6 +183,17 @@ def rollup_padded_addresses(datasource: DataSource) -> set[str]:
184
183
  return set(datasource.grouping_sets.keys)
185
184
 
186
185
 
186
+ def _optional_leaf_addresses(datasource: BuildDatasource) -> set[str]:
187
+ """What a table's own `?` bindings let it hold no member of. A column
188
+ nullable only because its concept declares NULL names a member on every
189
+ row, so it weakens no claim."""
190
+ out: set[str] = set()
191
+ for concept in datasource.optional_concepts:
192
+ out.add(concept.address)
193
+ out.update(concept.pseudonyms)
194
+ return out
195
+
196
+
187
197
  def _no_leaf_addresses(datasource: BuildDatasource) -> set[str]:
188
198
  return set()
189
199
 
@@ -133,10 +133,12 @@ def inject_condition_at_node(
133
133
  combine_existing: bool = True,
134
134
  planned_pairs: PlannedPairs | None = None,
135
135
  applied: BoolExpr | None = None,
136
+ gates: frozenset[int] = frozenset(),
136
137
  ) -> StrategyNode:
137
138
  """`applied` is what the request WHERE already filtered `node` by: the
138
139
  merge must not pad that branch, or a feeder's group the scan rejected comes
139
- back as a row."""
140
+ back as a row. `gates` are the feeders that are WHERE aggregates' own
141
+ groups: they keep no row of their own."""
140
142
  if condition_on_merge:
141
143
  combined = and_optional(
142
144
  node.conditions if combine_existing else None, condition.conditional
@@ -189,6 +191,7 @@ def inject_condition_at_node(
189
191
  hidden_concepts=hidden_concepts,
190
192
  existence_concepts=sources.existence_concepts,
191
193
  planned_pairs=planned_pairs,
194
+ gates=gates,
192
195
  )
193
196
 
194
197
  base = node
@@ -2694,6 +2694,16 @@ class RowProvider:
2694
2694
  minted: GroupBucket | None = None
2695
2695
 
2696
2696
 
2697
+ def _feeds_a_set(group_graph: nx.DiGraph, group_edges: EdgeMap, gid: str) -> bool:
2698
+ """Some reader of `gid` is a set or feeds only sets."""
2699
+ return any(
2700
+ only_a_set(group_graph, group_edges, reader)
2701
+ or feeds_only_sets(group_graph, group_edges, reader)
2702
+ for reader in group_graph.successors(gid)
2703
+ if reader != FINAL_NODE_ID
2704
+ )
2705
+
2706
+
2697
2707
  def _regraft_candidate(
2698
2708
  group_graph: nx.DiGraph,
2699
2709
  group_edges: EdgeMap,
@@ -2775,9 +2785,11 @@ def _regraft_candidate(
2775
2785
  full = covered >= needed
2776
2786
  # a redirect onto grouped rows keeps only their keys: a reader pairing
2777
2787
  # `gid` with other rows on its own grain finds none of it there
2788
+ # Nor for FINAL off a group a set reads: its keys are the set's
2789
+ # grouping, not `gid`'s (`Filters.regraft_keeps_paired_key`)
2778
2790
  if (
2779
2791
  full
2780
- and paired_downstream
2792
+ and (paired_downstream or _feeds_a_set(group_graph, group_edges, candidate))
2781
2793
  and cattrs.derivation in GROUPING_DERIVATIONS
2782
2794
  and not pairing_keys(grain) <= sets.outputs_of(candidate)
2783
2795
  ):
@@ -1309,8 +1309,10 @@ def plan_final_join(
1309
1309
  or pairing.kind == PairingKind.SCALAR
1310
1310
  )
1311
1311
  if columns:
1312
- pairings = tuple(_keyed_on_held(p, columns, carries) for p in pairings)
1313
- return JoinPlan(
1312
+ pairings = tuple(
1313
+ _keyed_on_held(p, columns, carries, pins, environment) for p in pairings
1314
+ )
1315
+ plan = JoinPlan(
1314
1316
  contributors,
1315
1317
  pins,
1316
1318
  identity,
@@ -1324,28 +1326,39 @@ def plan_final_join(
1324
1326
  over_groups=frozenset(
1325
1327
  gid for gid in supplying if _over_groups_only(group_graph, attrs, gid)
1326
1328
  ),
1327
- ).with_split(split)
1329
+ )
1330
+ return _without_bridged_blends(plan, attrs, environment).with_split(split)
1328
1331
 
1329
1332
 
1330
1333
  def _keyed_on_held(
1331
1334
  pairing: Pairing,
1332
1335
  columns: Mapping[str, frozenset[str]],
1333
1336
  carries: dict[str, frozenset[str]],
1337
+ pins: Mapping[str, frozenset[str]],
1338
+ environment: BuildEnvironment,
1334
1339
  ) -> Pairing:
1335
1340
  """A filter claims the select's grain but holds its groups' keys: where
1336
1341
  its node lacks a key of the pairing, the columns the keys determine and
1337
1342
  it holds key it in that key's place, for resolve drops a key a side lacks
1338
- (`Filters.built_filter_keys_its_groups`)."""
1339
- promoted = frozenset().union(
1340
- *(
1341
- pairing.implied & held & carries[other]
1342
- for side, other in (
1343
- (pairing.left, pairing.right),
1344
- (pairing.right, pairing.left),
1345
- )
1346
- if (held := columns.get(side)) is not None and pairing.keys - held
1347
- )
1348
- )
1343
+ (`Filters.built_filter_keys_its_groups`). A key of its own rows the
1344
+ missing one determines does too: `tree_form` for a claimed `tree_id`
1345
+ (`Filters.claimed_key_pairs_on_held`)."""
1346
+ promoted: frozenset[str] = frozenset()
1347
+ for side, other in ((pairing.left, pairing.right), (pairing.right, pairing.left)):
1348
+ held = columns.get(side)
1349
+ if held is None or not (missing := pairing.keys - held):
1350
+ continue
1351
+ keyed = pairing.implied & held & carries[other]
1352
+ # a key of the side's own rows the missing one determines: the other
1353
+ # side looks it up off a key it carries
1354
+ looked_up = (
1355
+ strict_fd_closure(environment, missing)
1356
+ & held
1357
+ & pins[side]
1358
+ & strict_fd_closure(environment, carries[other])
1359
+ ) - pairing.keys
1360
+ carries[other] |= looked_up
1361
+ promoted |= keyed | looked_up
1349
1362
  if not promoted:
1350
1363
  return pairing
1351
1364
  return replace(
@@ -1469,7 +1482,20 @@ def _underkeyed_blends(
1469
1482
  determines of the other's (`count(id)` by city, species beside `max(x) by
1470
1483
  city, tree_form`, paired on city alone): the merge needs a side holding
1471
1484
  the determined key too (`SelectGrain.by_property_without_its_key_misjoins`)."""
1472
- count = 0
1485
+ return sum(
1486
+ not bridged
1487
+ for _, bridged in _blend_gaps(plan, attrs, environment, reader_grain)
1488
+ )
1489
+
1490
+
1491
+ def _blend_gaps(
1492
+ plan: JoinPlan,
1493
+ attrs: dict[str, GroupAttrs],
1494
+ environment: BuildEnvironment,
1495
+ reader_grain: frozenset[str] = frozenset(),
1496
+ ) -> Iterator[tuple[Pairing, bool]]:
1497
+ """Each underkeyed blend, and whether an extra bridges both its sides on
1498
+ their identities."""
1473
1499
  for p in plan.pairings:
1474
1500
  if p.kind != PairingKind.BLEND or not {p.left, p.right} <= plan.suppliers:
1475
1501
  continue
@@ -1492,13 +1518,23 @@ def _underkeyed_blends(
1492
1518
  or _reader_pinned(plan, p, reader_grain, environment)
1493
1519
  ):
1494
1520
  continue
1495
- if not any(
1521
+ yield p, any(
1496
1522
  _bridges_on_identity(plan, extra, p.left, environment)
1497
1523
  and _bridges_on_identity(plan, extra, p.right, environment)
1498
1524
  for extra in plan.extras
1499
- ):
1500
- count += 1
1501
- return count
1525
+ )
1526
+
1527
+
1528
+ def _without_bridged_blends(
1529
+ plan: JoinPlan, attrs: dict[str, GroupAttrs], environment: BuildEnvironment
1530
+ ) -> JoinPlan:
1531
+ """A blend a bridge pairs on both sides' identities is joined through the
1532
+ bridge: its shared keys alone pair every row that shares them, a filtered
1533
+ value's NULL rows included (`Filters.bridged_blend_pairs_through_bridge`)."""
1534
+ bridged = {p for p, through in _blend_gaps(plan, attrs, environment) if through}
1535
+ if not bridged:
1536
+ return plan
1537
+ return replace(plan, pairings=tuple(p for p in plan.pairings if p not in bridged))
1502
1538
 
1503
1539
 
1504
1540
  def _pinned_finer(plan: JoinPlan, p: Pairing, environment: BuildEnvironment) -> bool: