pytrilogy 0.3.549__tar.gz → 0.3.552__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 (459) hide show
  1. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/PKG-INFO +1 -1
  2. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/pyproject.toml +1 -0
  3. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/__init__.py +1 -1
  4. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/enums.py +3 -1
  5. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/fingerprint.py +1 -1
  6. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/build.py +9 -0
  7. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/execute.py +103 -51
  8. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/merge_irrelevant_group_by.py +41 -16
  9. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/predicate_pushdown.py +4 -2
  10. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/utils.py +4 -1
  11. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/condition_utility.py +11 -2
  12. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/consumer_proofs.py +2 -2
  13. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/grain_utility.py +15 -18
  14. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/concept_graph.py +78 -1
  15. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/condition_placement.py +156 -16
  16. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/extent_ownership.py +13 -1
  17. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/final_cover.py +11 -5
  18. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/group_graph.py +9 -0
  19. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/group_rules.py +6 -1
  20. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/join_plan.py +31 -11
  21. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/keyspace.py +8 -1
  22. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/models.py +6 -3
  23. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/strategy_builder.py +57 -10
  24. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/filter.py +2 -1
  25. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/source_pushdown.py +18 -3
  26. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/datasource_rules.py +10 -1
  27. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/Cargo.lock +1 -1
  28. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/Cargo.toml +1 -1
  29. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/.scripts/__init__.py +0 -0
  30. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/.scripts/build_backend.py +0 -0
  31. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/.scripts/sync_version.py +0 -0
  32. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/LICENSE.md +0 -0
  33. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/README.md +0 -0
  34. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/README.md +0 -0
  35. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/__init__.py +0 -0
  36. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/constants.py +0 -0
  37. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/conversation.py +0 -0
  38. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/enums.py +0 -0
  39. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/execute.py +0 -0
  40. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/models.py +0 -0
  41. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/prompts.py +0 -0
  42. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/__init__.py +0 -0
  43. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/anthropic.py +0 -0
  44. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/base.py +0 -0
  45. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/deepseek.py +0 -0
  46. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/google.py +0 -0
  47. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/openai.py +0 -0
  48. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/openrouter.py +0 -0
  49. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/providers/utils.py +0 -0
  50. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/ai/syntax_examples.py +0 -0
  51. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/authoring/README.md +0 -0
  52. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/authoring/__init__.py +0 -0
  53. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/constants.py +0 -0
  54. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/README.md +0 -0
  55. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/__init__.py +0 -0
  56. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/assertions.py +0 -0
  57. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/average_parts.py +0 -0
  58. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/casts.py +0 -0
  59. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/constants.py +0 -0
  60. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/domain_graph.py +0 -0
  61. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/domain_validation.py +0 -0
  62. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/env_processor.py +0 -0
  63. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/environment_helpers.py +0 -0
  64. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/ergonomics.py +0 -0
  65. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/exceptions.py +0 -0
  66. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/functions.py +0 -0
  67. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/grain_pin.py +0 -0
  68. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/graph.py +0 -0
  69. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/graph_models.py +0 -0
  70. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/having_normalization.py +0 -0
  71. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/internal.py +0 -0
  72. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/like_patterns.py +0 -0
  73. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/__init__.py +0 -0
  74. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/author.py +0 -0
  75. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/build_environment.py +0 -0
  76. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/copying.py +0 -0
  77. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/core.py +0 -0
  78. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/datasource.py +0 -0
  79. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/environment.py +0 -0
  80. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/keyspace.py +0 -0
  81. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/models/reference_index.py +0 -0
  82. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimization.py +0 -0
  83. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/__init__.py +0 -0
  84. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/atom_contract.py +0 -0
  85. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/base_optimization.py +0 -0
  86. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/collapse_single_parent.py +0 -0
  87. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/existence_having_fold.py +0 -0
  88. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/filtered_aggregate.py +0 -0
  89. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/full_join_lowering.py +0 -0
  90. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/hide_unused_concept.py +0 -0
  91. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/identity_group.py +0 -0
  92. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/inline_datasource.py +0 -0
  93. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/join_hoist.py +0 -0
  94. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/merge_twin_scans.py +0 -0
  95. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/null_safe_join.py +0 -0
  96. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/order_inner_joins.py +0 -0
  97. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/preserved_join_keys.py +0 -0
  98. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/reuse_parent_lookup.py +0 -0
  99. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/semi_join_pushdown.py +0 -0
  100. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/strip_redundant_not_null.py +0 -0
  101. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/union_dim_pushdown.py +0 -0
  102. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/optimizations/value_set_join_upgrade.py +0 -0
  103. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/README.md +0 -0
  104. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/__init__.py +0 -0
  105. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/aggregate_rollup.py +0 -0
  106. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/basic_graph.py +0 -0
  107. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/concept_strategies_v4.py +0 -0
  108. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/constants.py +0 -0
  109. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/discovery_utility.py +0 -0
  110. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/discovery_validation.py +0 -0
  111. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/join_key_groups.py +0 -0
  112. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/join_resolution.py +0 -0
  113. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/model_ambiguity.py +0 -0
  114. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/__init__.py +0 -0
  115. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/common.py +0 -0
  116. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/presence_probe.py +0 -0
  117. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
  118. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_helpers/condition_routing.py +0 -0
  119. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
  120. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_helpers/datasource_nodes.py +0 -0
  121. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_helpers/source_scoring.py +0 -0
  122. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
  123. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/node_generators/select_node.py +0 -0
  124. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/README.md +0 -0
  125. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/__init__.py +0 -0
  126. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/base_node.py +0 -0
  127. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/filter_node.py +0 -0
  128. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/group_node.py +0 -0
  129. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/merge_node.py +0 -0
  130. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/recursive_node.py +0 -0
  131. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
  132. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/subselect_node.py +0 -0
  133. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/union_node.py +0 -0
  134. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/unnest_node.py +0 -0
  135. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/nodes/window_node.py +0 -0
  136. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/null_provenance.py +0 -0
  137. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/partial_bridging.py +0 -0
  138. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/plan_trace.py +0 -0
  139. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/plan_trace_model.py +0 -0
  140. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/relation_rollup.py +0 -0
  141. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/scan_partials.py +0 -0
  142. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/source_dominance.py +0 -0
  143. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/statement_scope.py +0 -0
  144. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/utility.py +0 -0
  145. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/__init__.py +0 -0
  146. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/condition_injection.py +0 -0
  147. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/constants.py +0 -0
  148. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/edges.py +0 -0
  149. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/functional_dependency.py +0 -0
  150. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/group_behaviors.py +0 -0
  151. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/history.py +0 -0
  152. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/network_build.py +0 -0
  153. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/network_coalescing.py +0 -0
  154. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/network_model.py +0 -0
  155. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/network_obligations.py +0 -0
  156. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/network_search.py +0 -0
  157. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/network_topology.py +0 -0
  158. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/projection.py +0 -0
  159. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/region_domains.py +0 -0
  160. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/region_reads.py +0 -0
  161. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/renders.py +0 -0
  162. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/root_partition.py +0 -0
  163. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/source_planning.py +0 -0
  164. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/staged_where.py +0 -0
  165. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_helper/union_arms.py +0 -0
  166. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/__init__.py +0 -0
  167. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/aggregate.py +0 -0
  168. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/basic.py +0 -0
  169. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/common.py +0 -0
  170. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/condition_sources.py +0 -0
  171. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/constant.py +0 -0
  172. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/dispatch.py +0 -0
  173. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/group_to.py +0 -0
  174. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/multiselect.py +0 -0
  175. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/nested_select.py +0 -0
  176. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/recursive.py +0 -0
  177. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/rollup_select.py +0 -0
  178. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/root.py +0 -0
  179. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/rowset.py +0 -0
  180. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/rowset_witness.py +0 -0
  181. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/subselect.py +0 -0
  182. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/union.py +0 -0
  183. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/union_select.py +0 -0
  184. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/unnest.py +0 -0
  185. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/processing/v4_node_generators/window.py +0 -0
  186. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/query_processor.py +0 -0
  187. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/scope_diagnostics.py +0 -0
  188. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/statements/README.md +0 -0
  189. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/statements/__init__.py +0 -0
  190. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/statements/author.py +0 -0
  191. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/statements/build.py +0 -0
  192. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/statements/common.py +0 -0
  193. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/statements/execute.py +0 -0
  194. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/table_processor.py +0 -0
  195. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/union_find.py +0 -0
  196. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/utility.py +0 -0
  197. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/README.md +0 -0
  198. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/__init__.py +0 -0
  199. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/common.py +0 -0
  200. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/concept.py +0 -0
  201. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/datasource.py +0 -0
  202. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/environment.py +0 -0
  203. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/fix.py +0 -0
  204. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/validation/rows.py +0 -0
  205. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/core/where_scope_normalization.py +0 -0
  206. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/__init__.py +0 -0
  207. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/base.py +0 -0
  208. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/bigquery.py +0 -0
  209. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/bigquery_engine.py +0 -0
  210. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/bigquery_persist.py +0 -0
  211. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/bigquery_staging.py +0 -0
  212. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/cancel.py +0 -0
  213. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/clickhouse.py +0 -0
  214. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/clickhouse_chdb.py +0 -0
  215. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/common.py +0 -0
  216. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/config.py +0 -0
  217. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/databricks.py +0 -0
  218. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/dataframe.py +0 -0
  219. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/duckdb.py +0 -0
  220. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/duckdb_pool.py +0 -0
  221. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/duckdb_uv.py +0 -0
  222. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/duckdb_vgi.py +0 -0
  223. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/enums.py +0 -0
  224. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/haybarn_engine.py +0 -0
  225. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/join_barriers.py +0 -0
  226. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/metadata.py +0 -0
  227. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/mock.py +0 -0
  228. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/mock_pattern.py +0 -0
  229. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/mysql.py +0 -0
  230. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/postgres.py +0 -0
  231. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/presto.py +0 -0
  232. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/python_source.py +0 -0
  233. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/results.py +0 -0
  234. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/snowflake.py +0 -0
  235. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/sql_server.py +0 -0
  236. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/sqlite.py +0 -0
  237. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/dialect/table_function.py +0 -0
  238. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/engine.py +0 -0
  239. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/__init__.py +0 -0
  240. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/assertions.py +0 -0
  241. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/client_copy.py +0 -0
  242. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/config.py +0 -0
  243. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/envs.py +0 -0
  244. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/model_fingerprint.py +0 -0
  245. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/outputs.py +0 -0
  246. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/report.py +0 -0
  247. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/staged_write.py +0 -0
  248. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/AGENTS.md +0 -0
  249. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/CLAUDE.md +0 -0
  250. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/__init__.py +0 -0
  251. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/cache.py +0 -0
  252. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/declaration.py +0 -0
  253. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/exceptions.py +0 -0
  254. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/isolation.py +0 -0
  255. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/partitions.py +0 -0
  256. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/persistence.py +0 -0
  257. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/phases.py +0 -0
  258. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/snapshot.py +0 -0
  259. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/state_store.py +0 -0
  260. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/state/watermarks.py +0 -0
  261. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/execution/write_order.py +0 -0
  262. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/executor.py +0 -0
  263. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/hooks/__init__.py +0 -0
  264. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/hooks/base_hook.py +0 -0
  265. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/hooks/graph_hook.py +0 -0
  266. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/hooks/query_debugger.py +0 -0
  267. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/__init__.py +0 -0
  268. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/adapters.py +0 -0
  269. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/arrow.py +0 -0
  270. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/click_support.py +0 -0
  271. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/contract.py +0 -0
  272. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/describe.py +0 -0
  273. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/errors.py +0 -0
  274. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/runner.py +0 -0
  275. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/sinks.py +0 -0
  276. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/io/vgi.py +0 -0
  277. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/metadata/__init__.py +0 -0
  278. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parser.py +0 -0
  279. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/README.md +0 -0
  280. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/__init__.py +0 -0
  281. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/common.py +0 -0
  282. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/exceptions.py +0 -0
  283. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/helpers.py +0 -0
  284. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/parse_engine_v2.py +0 -0
  285. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/pretty.py +0 -0
  286. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/render.py +0 -0
  287. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/trilogy.lark +0 -0
  288. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/README.md +0 -0
  289. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/__init__.py +0 -0
  290. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/concept_syntax.py +0 -0
  291. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/errors.py +0 -0
  292. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/function_syntax.py +0 -0
  293. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/hydration.py +0 -0
  294. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/import_service.py +0 -0
  295. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/lark_backend.py +0 -0
  296. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/model.py +0 -0
  297. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/pest_backend.py +0 -0
  298. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rowset_semantics.py +0 -0
  299. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/__init__.py +0 -0
  300. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/chart_rules.py +0 -0
  301. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/concept_rules.py +0 -0
  302. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/conditional_rules.py +0 -0
  303. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/expression_rules.py +0 -0
  304. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/function_definition_rules.py +0 -0
  305. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/function_rules.py +0 -0
  306. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/import_rules.py +0 -0
  307. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/merge_rules.py +0 -0
  308. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/multiselect_rules.py +0 -0
  309. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/operational_rules.py +0 -0
  310. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/order_rules.py +0 -0
  311. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/persist_rules.py +0 -0
  312. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/rawsql_rules.py +0 -0
  313. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/rollup_lift.py +0 -0
  314. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/rowset_rules.py +0 -0
  315. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/select_rules.py +0 -0
  316. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/select_statement_rules.py +0 -0
  317. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/statement_rules.py +0 -0
  318. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/subselect_rules.py +0 -0
  319. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/token_rules.py +0 -0
  320. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/tvf_rules.py +0 -0
  321. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules/type_rules.py +0 -0
  322. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/rules_context.py +0 -0
  323. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/select_finalize.py +0 -0
  324. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/semantic_scope.py +0 -0
  325. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/semantic_state.py +0 -0
  326. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/statement_planner.py +0 -0
  327. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/statement_plans.py +0 -0
  328. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/symbols.py +0 -0
  329. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/parsing/v2/syntax.py +0 -0
  330. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/py.typed +0 -0
  331. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/render.py +0 -0
  332. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/__init__.py +0 -0
  333. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/altair_renderer.py +0 -0
  334. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/base.py +0 -0
  335. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/chart_theme.py +0 -0
  336. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/rich_types.py +0 -0
  337. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/terminal_renderer.py +0 -0
  338. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/rendering/theme.py +0 -0
  339. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/__init__.py +0 -0
  340. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/backends/__init__.py +0 -0
  341. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/backends/base.py +0 -0
  342. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/backends/html.py +0 -0
  343. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/backends/png.py +0 -0
  344. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/charts.py +0 -0
  345. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/document.py +0 -0
  346. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/runner.py +0 -0
  347. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/report/tables.py +0 -0
  348. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/AGENTS.md +0 -0
  349. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/CLAUDE.md +0 -0
  350. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/README.md +0 -0
  351. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/__init__.py +0 -0
  352. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent.py +0 -0
  353. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_info.py +0 -0
  354. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_info_docs/__init__.py +0 -0
  355. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_info_docs/cli.py +0 -0
  356. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_info_docs/content.py +0 -0
  357. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_info_docs/directory.py +0 -0
  358. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_render.py +0 -0
  359. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_sessions.py +0 -0
  360. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_sql_tools.py +0 -0
  361. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/agent_tools.py +0 -0
  362. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/click_utils.py +0 -0
  363. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/cloud.py +0 -0
  364. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/cloud_models.py +0 -0
  365. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/common.py +0 -0
  366. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/database.py +0 -0
  367. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/README.md +0 -0
  368. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/build.sh +0 -0
  369. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/examples/basic_usage.rs +0 -0
  370. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/directory_resolver.rs +0 -0
  371. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/graph.rs +0 -0
  372. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/lib.rs +0 -0
  373. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/main.rs +0 -0
  374. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/network_search.rs +0 -0
  375. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/parser.rs +0 -0
  376. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/python_bindings.rs +0 -0
  377. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/resolver.rs +0 -0
  378. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/trilogy.pest +0 -0
  379. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/src/trilogy_parser.rs +0 -0
  380. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/base.preql +0 -0
  381. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/cli_integration.rs +0 -0
  382. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/customer.preql +0 -0
  383. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/main.preql +0 -0
  384. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/nesting_limit.rs +0 -0
  385. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/orders.preql +0 -0
  386. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/parse_cost.rs +0 -0
  387. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/public_api.rs +0 -0
  388. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/test_data/base.preql +0 -0
  389. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency/tests/test_data/consumer.preql +0 -0
  390. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/dependency.py +0 -0
  391. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display.py +0 -0
  392. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_core.py +0 -0
  393. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_execution.py +0 -0
  394. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_ingest.py +0 -0
  395. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_init.py +0 -0
  396. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_models.py +0 -0
  397. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_parallel.py +0 -0
  398. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_refresh.py +0 -0
  399. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/display_validation.py +0 -0
  400. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/env_commands.py +0 -0
  401. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/environment.py +0 -0
  402. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/explore.py +0 -0
  403. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/explore_seen.py +0 -0
  404. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/file.py +0 -0
  405. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/file_helpers/__init__.py +0 -0
  406. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/file_helpers/backends.py +0 -0
  407. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/file_helpers/preql_description.py +0 -0
  408. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/file_helpers/preql_validation.py +0 -0
  409. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/fmt.py +0 -0
  410. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest.py +0 -0
  411. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest_helpers/__init__.py +0 -0
  412. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest_helpers/fk_inference.py +0 -0
  413. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest_helpers/foreign_keys.py +0 -0
  414. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest_helpers/formatting.py +0 -0
  415. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest_helpers/introspection.py +0 -0
  416. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/ingest_helpers/typing.py +0 -0
  417. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/init.py +0 -0
  418. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/parallel_execution.py +0 -0
  419. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/plan.py +0 -0
  420. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/project_config.py +0 -0
  421. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/public.py +0 -0
  422. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/refresh.py +0 -0
  423. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/render.py +0 -0
  424. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/run.py +0 -0
  425. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve.py +0 -0
  426. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/__init__.py +0 -0
  427. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/connection_spec.py +0 -0
  428. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/file_discovery.py +0 -0
  429. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/index_generation.py +0 -0
  430. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/jobs.py +0 -0
  431. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/mcp_server.py +0 -0
  432. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/models.py +0 -0
  433. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/state_cache.py +0 -0
  434. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/state_computation.py +0 -0
  435. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/serve_helpers/studio_bundle.py +0 -0
  436. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/single_execution.py +0 -0
  437. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/source.py +0 -0
  438. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/source_identity.py +0 -0
  439. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/state.py +0 -0
  440. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/testing.py +0 -0
  441. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/trilogy.py +0 -0
  442. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/scripts/validate_agent.py +0 -0
  443. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/staging.py +0 -0
  444. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/__init__.py +0 -0
  445. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/bytes.preql +0 -0
  446. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/chart.preql +0 -0
  447. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/collection.preql +0 -0
  448. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/color.preql +0 -0
  449. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/currency.preql +0 -0
  450. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/date.preql +0 -0
  451. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/display.preql +0 -0
  452. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/geography.preql +0 -0
  453. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/metric.preql +0 -0
  454. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/money.preql +0 -0
  455. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/net.preql +0 -0
  456. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/ranking.preql +0 -0
  457. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/report.preql +0 -0
  458. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/std/semantic.preql +0 -0
  459. {pytrilogy-0.3.549 → pytrilogy-0.3.552}/trilogy/utility.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytrilogy
3
- Version: 0.3.549
3
+ Version: 0.3.552
4
4
  Classifier: Programming Language :: Python
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.11
@@ -21,6 +21,7 @@ markers = [
21
21
  "clickhouse_server: marks tests as requiring a real ClickHouse server (env vars TRILOGY_CLICKHOUSE_*)",
22
22
  "databricks_server: marks tests as requiring a real Databricks SQL warehouse (env vars DATABRICKS_*)",
23
23
  "bigquery_execution: marks tests as requiring a real BigQuery project + GCS staging (env vars TRILOGY_BIGQUERY_*)",
24
+ "gcp_credentials: marks tests as needing Google Cloud credentials (ADC for BigQuery, GOOGLE_HMAC_* for GCS); skipped when TRILOGY_SKIP_GCP_CREDENTIAL_TESTS is set",
24
25
  "v4_parity: discovery planner correctness cases (local_scripts/v4_evals)",
25
26
  "cloud_live: marks tests as hitting a real trilogy-cloud API and triggering real job runs (env vars TRILOGY_CLOUD_TOKEN + TRILOGY_CLOUD_API)",
26
27
  ]
@@ -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.549"
10
+ __version__ = "0.3.552"
11
11
 
12
12
  __all__ = [
13
13
  "CONFIG",
@@ -502,8 +502,10 @@ NULL_STRICT_FUNCTIONS: frozenset[FunctionType] = frozenset(
502
502
  {
503
503
  FunctionType.ALIAS,
504
504
  FunctionType.PARENTHETICAL,
505
- # a value grouped by or pinned to its anchors exists on their rows only
505
+ # a value grouped by its anchors exists on their rows only
506
506
  FunctionType.GROUP,
507
+ # strict in its expression; its anchors say where it is evaluated
508
+ # (`condition_utility._strict_arguments`)
507
509
  FunctionType.GRAIN_PIN,
508
510
  FunctionType.CAST,
509
511
  FunctionType.CONCAT_STRICT,
@@ -193,7 +193,7 @@ def _address_token(address: Address | str) -> str:
193
193
  *address.partition_columns,
194
194
  *additional,
195
195
  *([f"#{address.source_name}"] if address.source_name else []),
196
- *(["args", *address.static_args] if address.script_args else []),
196
+ *(["args", *address.static_args] if address.static_args else []),
197
197
  )
198
198
 
199
199
 
@@ -315,6 +315,15 @@ def is_grouping_identity(concept: BuildConcept) -> bool:
315
315
  )
316
316
 
317
317
 
318
+ def is_grain_pinned(value: object) -> bool:
319
+ """A value evaluated on the select's rows (`grain_pin`): its anchors say
320
+ where, and a row padded on one still evaluates it, so it proves none of
321
+ them and no padded row lacks it."""
322
+ if isinstance(value, BuildConcept):
323
+ value = value.lineage
324
+ return isinstance(value, BuildFunction) and value.operator == FunctionType.GRAIN_PIN
325
+
326
+
318
327
  def concept_is_relevant(
319
328
  concept: BuildConcept,
320
329
  others: list[BuildConcept],
@@ -51,6 +51,7 @@ from trilogy.core.models.build import (
51
51
  DataType,
52
52
  LooseBuildConceptList,
53
53
  RawColumnExpr,
54
+ get_concept_row_arguments,
54
55
  )
55
56
  from trilogy.core.models.datasource import Address
56
57
  from trilogy.core.utility import safe_quote
@@ -210,45 +211,97 @@ def _reads_same_sets(
210
211
 
211
212
  def filter_case_elided(cte: CTE | UnionCTE, lineage: BuildFilterItem) -> bool:
212
213
  """A filter's per-row CASE WHEN is redundant, and renders as bare content,
213
- when the CTE's WHERE implies its predicate, or its parents guarantee it:
214
- plain-CTE parents whose conditions imply the predicate supply every column
215
- the filter reads, under no join that could NULL-pad a row (INNER only)
216
- (a group parent's HAVING holding the filter's aggregate condition)."""
217
- from trilogy.core.processing.condition_utility import condition_implies
214
+ when every AND-atom of its predicate holds on every row this CTE reads
215
+ (`_atom_holds`). One predicate may be held partly by the CTE's own WHERE
216
+ and partly by parents, as when pushdown moves some atoms of the WHERE
217
+ into a parent's HAVING."""
218
+ from trilogy.core.processing.condition_utility import (
219
+ condition_implies,
220
+ decompose_condition,
221
+ )
218
222
 
219
223
  where_cond = lineage.where.conditional
224
+ own = cte.condition
225
+ if own is not None and (own == where_cond or condition_implies(own, where_cond)):
226
+ return True
227
+ return all(
228
+ _atom_holds(cte, atom, lineage) for atom in decompose_condition(where_cond)
229
+ )
230
+
231
+
232
+ def _atom_holds(cte: CTE | UnionCTE, atom: BoolExpr, lineage: BuildFilterItem) -> bool:
233
+ """The CTE's own condition implies the atom, or, under no join that could
234
+ NULL-pad a row (INNER only), every column the atom reads comes from plain
235
+ CTE parents where it holds: a group parent's HAVING holding the filter's
236
+ aggregate condition, or a projection passing that column through from
237
+ one."""
238
+ from trilogy.core.processing.condition_utility import condition_implies
239
+
240
+ if not isinstance(cte, CTE):
241
+ return False
220
242
  if cte.condition is not None and (
221
- cte.condition == where_cond or condition_implies(cte.condition, where_cond)
243
+ atom == cte.condition or condition_implies(cte.condition, atom)
222
244
  ):
223
245
  return True
224
- if not cte.parent_ctes:
225
- return False
226
- if isinstance(cte, CTE) and any(
246
+ if any(
227
247
  not isinstance(join, Join) or join.join_type != JoinType.INNER
228
248
  for join in cte.joins
229
249
  ):
230
250
  return False
231
- guaranteeing = {
232
- parent.name
233
- for parent in cte.parent_ctes
234
- if isinstance(parent, CTE)
235
- and parent.condition is not None
236
- and (
237
- where_cond == parent.condition
238
- or condition_implies(parent.condition, where_cond)
251
+ parents = {parent.name: parent for parent in cte.parent_ctes}
252
+ refs = get_concept_row_arguments(atom)
253
+ return bool(refs) and all(
254
+ (sources := cte.source_map.get(r.address))
255
+ and all(
256
+ isinstance(parent := parents.get(source), CTE)
257
+ and _reads_same_sets(cte, parent, lineage)
258
+ and _atom_holds(parent, atom, lineage)
259
+ for source in sources
239
260
  )
240
- and _reads_same_sets(cte, parent, lineage)
241
- }
242
- if not guaranteeing:
243
- return False
244
- refs = {a.address for a in lineage.content_concept_arguments}
245
- refs |= {a.address for a in lineage.where.row_arguments}
246
- return all(
247
- (sources := cte.source_map.get(r)) and set(sources) <= guaranteeing
248
261
  for r in refs
249
262
  )
250
263
 
251
264
 
265
+ def collapses_at(c: BuildConcept, grain: set[str]) -> bool:
266
+ """A filter whose keys the grain holds but whose predicate reads outside
267
+ it is a property of the grain, not a grouping key: the per-row ``CASE
268
+ WHEN cond THEN content END`` fans a key out into ``{content, NULL}``, so
269
+ a GROUP BY on it breaks the stream's dedup to the grain. A keyless
270
+ one-value filter collapses only in a one-row group."""
271
+ if not isinstance(c.lineage, BuildFilterItem):
272
+ return False
273
+ keys = c.keys or set()
274
+ if keys:
275
+ if not keys <= grain:
276
+ return False
277
+ elif grain or c.granularity != Granularity.SINGLE_ROW:
278
+ return False
279
+ return not {a.address for a in c.lineage.where.row_arguments} <= grain
280
+
281
+
282
+ def collapsed_filters(cte: CTE) -> frozenset[str]:
283
+ """The filters a grouping CTE renders (an output, or an argument of one
284
+ it computes) that collapse at its grain (`collapses_at`)."""
285
+ if not cte.group_to_grain:
286
+ return frozenset()
287
+ grain = set(cte.grain.components)
288
+ found: set[str] = set()
289
+ seen: set[str] = set()
290
+ stack = list(cte.output_columns)
291
+ while stack:
292
+ c = stack.pop()
293
+ if c.address in seen:
294
+ continue
295
+ seen.add(c.address)
296
+ if collapses_at(c, grain):
297
+ found.add(c.address)
298
+ if not cte.source_map.get(c.address) and isinstance(
299
+ c.lineage, BuildConceptArgs
300
+ ):
301
+ stack.extend(c.lineage.concept_arguments)
302
+ return frozenset(found)
303
+
304
+
252
305
  @dataclass
253
306
  class CTE:
254
307
  name: str
@@ -280,6 +333,9 @@ class CTE:
280
333
  partial_sources: dict[str, BuildConcept] = field(default_factory=dict)
281
334
  # See `QueryDatasource.grouping_sets`.
282
335
  grouping_sets: BuildGroupingSets | None = None
336
+ # The filters this CTE collapses to its grain (`collapsed_filters`),
337
+ # decided on the grain it is born with; None until then.
338
+ collapsed_filters: frozenset[str] | None = None
283
339
  order_by: BuildOrderBy | None = None
284
340
  limit: int | None = None
285
341
  base_name_override: Address | str | None = None
@@ -297,6 +353,8 @@ class CTE:
297
353
  # Own the list: callers pass a node's or a source's, which the
298
354
  # optimizers grow in place.
299
355
  self.output_columns = assume_unique(list(self.output_columns))
356
+ if self.collapsed_filters is None:
357
+ self.collapsed_filters = collapsed_filters(self)
300
358
 
301
359
  @classmethod
302
360
  def from_datasource(cls, datasource: BuildDatasource) -> DatasourceCTE:
@@ -505,6 +563,7 @@ class CTE:
505
563
  )
506
564
  self.region_zero_filled = self.region_zero_filled | other.region_zero_filled
507
565
  self.zero_filled = self.zero_filled | other.zero_filled
566
+ self.collapsed_filters = self.collapsed | other.collapsed
508
567
  self.distinct_counts = self.distinct_counts | other.distinct_counts
509
568
  self.partial_sources = {**self.partial_sources, **other.partial_sources}
510
569
  self.hidden_concepts = mutually_hidden
@@ -814,6 +873,7 @@ class CTE:
814
873
  else self.zero_filled
815
874
  )
816
875
  self.group_to_grain = group
876
+ self.collapsed_filters = collapsed_filters(self)
817
877
  self.zero_filled = zero_filled_counts(
818
878
  self.output_columns,
819
879
  self.nullable_concepts,
@@ -821,35 +881,27 @@ class CTE:
821
881
  kept,
822
882
  )
823
883
 
884
+ @property
885
+ def collapsed(self) -> frozenset[str]:
886
+ return self.collapsed_filters or frozenset()
887
+
824
888
  def filter_collapses_to_grain(self, c: BuildConcept) -> bool:
825
- """A filter virtual whose keys are covered by this grouping CTE's grain
826
- but whose predicate reads columns outside it is a property of the grain,
827
- not a grouping key: the per-row ``CASE WHEN cond THEN content END`` fans
828
- a mixed key out into ``{content, NULL}``, so keeping it in GROUP BY
829
- breaks the contract that the stream is deduplicated to the grain. The
830
- renderer collapses it with MAX instead (dialect/base.py). A parent that
831
- computed it per row hands this CTE the same fan-out; MAX of a value the
832
- grain determines is that value. When the CTE's own condition implies
833
- the predicate, its own CASE is elided to bare content, which the grain
834
- determines, and it stays a group key."""
835
-
836
- if not (
837
- self.group_to_grain
838
- and c.derivation == Derivation.FILTER
839
- and isinstance(c.lineage, BuildFilterItem)
889
+ """A filter virtual this CTE collapses to its grain (`collapsed_filters`)
890
+ renders as ``MAX(CASE ...)`` and stays out of the GROUP BY, unless its
891
+ CASE never fans out here: this CTE's own WHERE reads it, or its
892
+ predicate holds on every row (`filter_case_elided`), so the bare
893
+ content, which the grain determines, stays a group key.
894
+
895
+ The grain half is the planner's: decided on the grain the CTE is born
896
+ with, re-decided where the optimizer regroups it (`regroup`), and
897
+ carried where it folds a child in (`carry_child_state`). The WHERE and
898
+ elision half reads the final CTE, since pushdown moves conditions
899
+ after planning (seams 47-49 of
900
+ `docs/query_gen_simplification_audit_2026_10.md`)."""
901
+ if c.address not in self.collapsed or not isinstance(
902
+ c.lineage, BuildFilterItem
840
903
  ):
841
904
  return False
842
- grain_components = set(self.grain.components)
843
- keys = c.keys or set()
844
- if keys:
845
- if not keys <= grain_components:
846
- return False
847
- elif grain_components or c.granularity != Granularity.SINGLE_ROW:
848
- # a keyless one-value filter collapses only in a one-row group
849
- return False
850
- where_args = {a.address for a in c.lineage.where.row_arguments}
851
- if where_args <= grain_components:
852
- return False
853
905
  if self.source_map.get(c.address, []):
854
906
  # this CTE's own WHERE runs before the GROUP BY and reads the row
855
907
  return not (
@@ -11,6 +11,7 @@ from trilogy.core.models.execute import (
11
11
  Join,
12
12
  RecursiveCTE,
13
13
  UnionCTE,
14
+ collapses_at,
14
15
  )
15
16
  from trilogy.core.optimizations.base_optimization import MergedCTEMap, OptimizationRule
16
17
  from trilogy.core.optimizations.utils import (
@@ -24,10 +25,7 @@ from trilogy.core.optimizations.utils import (
24
25
  render_cte_used_map,
25
26
  repoint_consumers,
26
27
  )
27
- from trilogy.core.processing.grain_utility import (
28
- join_preserves_left_rows,
29
- stacks_duplicate_rows,
30
- )
28
+ from trilogy.core.processing.grain_utility import rows_identity_at
31
29
  from trilogy.utility import append_new, assume_unique
32
30
 
33
31
  # The child must be pure scalar transforms so its GROUP BY is vacuous
@@ -67,6 +65,34 @@ def _drops_dedup_measure(cte: CTE, parent: CTE) -> bool:
67
65
  return False
68
66
 
69
67
 
68
+ def _drops_planned_collapse(cte: CTE, parent: CTE) -> bool:
69
+ """The parent collapses a filter to its grain (`MAX(CASE ...)`) that the
70
+ child's grain would not: the fused CTE carries the parent's stamp
71
+ (`CTE.collapsed_filters`) to a grain that drops the filter's keys, where
72
+ the collapse answers one value for many rows."""
73
+ grain = set(cte.grain.components)
74
+ return any(
75
+ parent.filter_collapses_to_grain(c) and not collapses_at(c, grain)
76
+ for c in parent.output_columns
77
+ )
78
+
79
+
80
+ def _restamped_collapses(cte: CTE, parent: CTE) -> frozenset[str]:
81
+ """The merged CTE's collapses at the child's grain: the child's own, and
82
+ the parent's that still collapse there. One that does not passed
83
+ `_drops_planned_collapse` elided, every row passing its predicate, so it is
84
+ a group key; kept, the stamp outlived the WHERE that elided it, which
85
+ pushdown can move below, and the filter collapsed at its own grain to one
86
+ row (`Filters.set_dedup_keeps_its_group`, 539591)."""
87
+ grain = set(cte.grain.components)
88
+ kept = {
89
+ c.address
90
+ for c in parent.output_columns
91
+ if c.address in parent.collapsed and collapses_at(c, grain)
92
+ }
93
+ return frozenset(kept) | cte.collapsed
94
+
95
+
70
96
  def _is_child_ineligible(concept: BuildConcept, cte: CTE, parent: CTE) -> bool:
71
97
  if concept.derivation not in CHILD_INELIGIBLE_DERIVATIONS:
72
98
  return False
@@ -89,18 +115,9 @@ def _identity_group_single_use_aggregate(cte: CTE, parent: CTE) -> bool:
89
115
  for source in parent.source.datasources
90
116
  if source.identifier not in right_ids
91
117
  ]
92
- if len(roots) != 1:
93
- return False
94
- # The grain check below only proves identity if the root is actually unique
95
- # at its declared grain; a union stack is not.
96
- if stacks_duplicate_rows(roots[0]):
97
- return False
98
- if not set(roots[0].grain.components) <= set(parent.grain.components):
99
- return False
100
- if any(
101
- not isinstance(join, Join) or not join_preserves_left_rows(join)
102
- for join in parent.joins
103
- ):
118
+ # the planner's identity proof (`is_identity_group`); a declared grain
119
+ # alone is not one (a list's repeated element pairs its row twice)
120
+ if len(roots) != 1 or not rows_identity_at(roots[0], parent.joins, parent.grain):
104
121
  return False
105
122
  parent_outputs = output_addresses(parent)
106
123
  input_counts: Counter[str] = Counter()
@@ -217,6 +234,12 @@ class MergeIrrelevantGroupBy(OptimizationRule):
217
234
  )
218
235
  return False, None
219
236
 
237
+ if _drops_planned_collapse(cte, parent):
238
+ self.debug(
239
+ f"CTE {cte.name}'s grain drops a filter {parent.name} collapses, skipping"
240
+ )
241
+ return False, None
242
+
220
243
  if not parent_has_aggregate and _drops_dedup_measure(cte, parent):
221
244
  self.debug(
222
245
  f"CTE {cte.name} aggregates a measure {parent.name} deduplicates on, skipping"
@@ -243,7 +266,9 @@ class MergeIrrelevantGroupBy(OptimizationRule):
243
266
  if x.address not in parent.source_map:
244
267
  parent.source_map[x.address] = []
245
268
 
269
+ collapsed = _restamped_collapses(cte, parent)
246
270
  carry_child_state(parent, cte)
271
+ parent.collapsed_filters = collapsed
247
272
 
248
273
  # The child's output_columns already carry the hidden group-by keys,
249
274
  # so the GROUP BY survives the swap.
@@ -128,7 +128,9 @@ def _parent_covers_condition(parent: CTE | UnionCTE, condition) -> bool:
128
128
  # Transitive hop: the parent may merely pass through rows an ancestor
129
129
  # already filtered (a join CTE reading a HAVING-filtered group). Every
130
130
  # source of every referenced column must be a covering, non-NULL-padded
131
- # ancestor.
131
+ # ancestor, and one: values read off two ancestors met on a row neither
132
+ # tested (`min(x) by city` off one group, `min(x) by species` off another,
133
+ # paired by an ungated row stream: `Filters.paired_values_passed_apart`).
132
134
  if not isinstance(condition, BuildConceptArgs):
133
135
  return False
134
136
  grandparents = {p.name: p for p in parent.dependency_nodes()}
@@ -138,7 +140,7 @@ def _parent_covers_condition(parent: CTE | UnionCTE, condition) -> bool:
138
140
  if not sources or not all(s in grandparents for s in sources):
139
141
  return False
140
142
  needed.update(sources)
141
- if not needed:
143
+ if len(needed) != 1:
142
144
  return False
143
145
  return all(
144
146
  not _parent_nullable_in_cte(parent, name)
@@ -100,7 +100,10 @@ def carry_child_state(parent: CTE, cte: CTE) -> None:
100
100
  rows, the stream that repeats their counted keys. LIMIT is the last
101
101
  logical operation of a SELECT, so the child's limit and ORDER BY apply
102
102
  unchanged to the merged CTE. Grouping sets: the child's aggregates now
103
- render on the parent, so the pass they run in does too."""
103
+ render on the parent, so the pass they run in does too. Collapsed
104
+ filters: the child's columns now render on the parent, collapsed as the
105
+ child's plan decided (`CTE.collapsed_filters`)."""
106
+ parent.collapsed_filters = parent.collapsed | cte.collapsed
104
107
  if cte.grouping_sets is not None:
105
108
  parent.grouping_sets = cte.grouping_sets
106
109
  parent.distinct_counts = parent.distinct_counts | cte.distinct_counts
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import math
4
- from collections.abc import Mapping
4
+ from collections.abc import Mapping, Sequence
5
5
  from datetime import date, datetime, timedelta
6
6
  from decimal import Decimal
7
7
  from enum import Enum
@@ -35,6 +35,7 @@ from trilogy.core.models.build import (
35
35
  BuildSubselectComparison,
36
36
  BuildWhereClause,
37
37
  BuildWindowItem,
38
+ is_grain_pinned,
38
39
  )
39
40
  from trilogy.core.models.core import (
40
41
  ArrayType,
@@ -1140,12 +1141,20 @@ def concepts_implied_non_null(value: object, per_group: bool = False) -> set[str
1140
1141
  ):
1141
1142
  return set()
1142
1143
  addresses: set[str] = set()
1143
- for arg in value.arguments:
1144
+ for arg in _strict_arguments(value):
1144
1145
  addresses |= concepts_implied_non_null(arg, per_group)
1145
1146
  return addresses
1146
1147
  return set()
1147
1148
 
1148
1149
 
1150
+ def _strict_arguments(value: BuildFunction) -> Sequence[object]:
1151
+ """A pinned value is its expression evaluated on the select's row: its
1152
+ anchors say where, and a row padded on one still evaluates it (`grain_pin`)."""
1153
+ if is_grain_pinned(value):
1154
+ return value.arguments[:1]
1155
+ return value.arguments
1156
+
1157
+
1149
1158
  def _non_null_or_disjuncts(
1150
1159
  atom: BoolExpr,
1151
1160
  ) -> list[BoolExpr]:
@@ -297,8 +297,8 @@ def lineage_proofs(node: StrategyNode, addresses: frozenset[str]) -> frozenset[s
297
297
  def _evaluated_at_a_grain(value: object) -> bool:
298
298
  """A grouped value is read at its anchors' grain, not off the row
299
299
  computing it: its anchor is not this row's column. A pinned value is
300
- (`grain_pin`): it has no value off its anchors' rows, as a property has
301
- none without its key, so it is NULL-strict on them."""
300
+ evaluated on this row (`grain_pin`), and proves what its expression
301
+ does."""
302
302
  if isinstance(value, BuildParenthetical):
303
303
  return _evaluated_at_a_grain(value.content)
304
304
  if not isinstance(value, BuildFunction):
@@ -1276,18 +1276,20 @@ def unique_at_declared_grain(source: GrainSource) -> bool:
1276
1276
  )
1277
1277
 
1278
1278
 
1279
- def stacks_duplicate_rows(source: GrainSource) -> bool:
1280
- """Whether ``source`` can emit repeated rows at its own declared grain: a
1281
- UNION stack does (its grouping establishes the grain rather than
1282
- restating it), a GROUP never does, anything else passes its inputs'
1283
- duplicates through."""
1284
- if not isinstance(source, QueryDatasource):
1285
- return False
1286
- if source.source_type == SourceType.UNION:
1287
- return True
1288
- if source.source_type == SourceType.GROUP:
1289
- return False
1290
- return any(stacks_duplicate_rows(sub) for sub in source.datasources)
1279
+ def rows_identity_at(
1280
+ root: GrainSource,
1281
+ joins: Iterable[SourceJoin | UnnestJoin],
1282
+ target_grain: BuildGrain,
1283
+ ) -> bool:
1284
+ """``root``'s rows, joined only to lookups, are already one per
1285
+ ``target_grain``: grouping them there keeps every row. An abstract grain
1286
+ is no grain: an ungrained source's keys need not be unique together."""
1287
+ return (
1288
+ not root.grain.abstract
1289
+ and unique_at_declared_grain(root)
1290
+ and set(root.grain.components) <= set(target_grain.components)
1291
+ and _only_lookup_joins(joins)
1292
+ )
1291
1293
 
1292
1294
 
1293
1295
  def is_identity_group(
@@ -1308,12 +1310,7 @@ def is_identity_group(
1308
1310
  roots = [source for source in datasets if source.identifier not in right_ids]
1309
1311
  if len(roots) != 1:
1310
1312
  return False
1311
- root = roots[0]
1312
- if not unique_at_declared_grain(root):
1313
- return False
1314
- if not set(root.grain.components) <= set(target_grain.components):
1315
- return False
1316
- if not _only_lookup_joins(joins):
1313
+ if not rows_identity_at(roots[0], joins, target_grain):
1317
1314
  return False
1318
1315
  supplied = {
1319
1316
  concept.address for source in datasets for concept in source.output_concepts
@@ -59,13 +59,20 @@ from trilogy.core.processing.node_generators.select_node import root_is_unsource
59
59
  from trilogy.utility import UniqueList, unique
60
60
 
61
61
  from .constants import (
62
+ AGGREGATING_DERIVATIONS,
62
63
  IN_SET_PLAN,
63
64
  REPEAT_BLIND_AGGREGATES,
64
65
  ROW_SHAPE_BARRIER_DERIVATIONS,
65
66
  DepthLabel,
66
67
  EdgeKind,
67
68
  )
68
- from .edges import EdgeMap, add_edge, edge_kind, lineage_subgraph
69
+ from .edges import (
70
+ EdgeMap,
71
+ add_edge,
72
+ edge_kind,
73
+ lineage_predecessors,
74
+ lineage_subgraph,
75
+ )
69
76
  from .functional_dependency import (
70
77
  concept_attr_fd_closure,
71
78
  minimize_build_grain,
@@ -1739,6 +1746,45 @@ def _total_beside_a_set(
1739
1746
  )
1740
1747
 
1741
1748
 
1749
+ def _windows_off_gate_keys(
1750
+ graph: nx.DiGraph, edges: EdgeMap, attrs: dict[str, ConceptAttrs], src: str
1751
+ ) -> bool:
1752
+ """A window the WHERE constrains numbers groups its grain names: where
1753
+ that grain does not determine the gate's keys, nothing pairs the gate
1754
+ with them, so it gates the rows the window reads
1755
+ (`Filters.window_off_gate_keys_reads_gated_rows`)."""
1756
+ keys = attrs[src].grain_components - {ALL_ROWS_ADDRESS}
1757
+ return bool(keys) and any(
1758
+ attrs[succ].derivation == Derivation.WINDOW
1759
+ and edge_kind(edges, src, succ) == EdgeKind.CONSTRAINT
1760
+ and not keys
1761
+ <= concept_attr_fd_closure(
1762
+ attrs, attrs[succ].grain_components, include_empty_grain=False
1763
+ )
1764
+ for succ in graph.successors(src)
1765
+ )
1766
+
1767
+
1768
+ def _reads_an_aggregate(
1769
+ graph: nx.DiGraph, edges: EdgeMap, attrs: dict[str, ConceptAttrs], node: str
1770
+ ) -> bool:
1771
+ """`node` reads a grouped value: its rows are that group's, which the gate
1772
+ reaches as a barrier of its own. A filter is a value of each row, whatever
1773
+ its condition reads."""
1774
+ seen: set[str] = set()
1775
+ stack = lineage_predecessors(graph, edges, node)
1776
+ while stack:
1777
+ cur = stack.pop()
1778
+ if cur in seen or cur not in attrs:
1779
+ continue
1780
+ seen.add(cur)
1781
+ if attrs[cur].derivation in AGGREGATING_DERIVATIONS:
1782
+ return True
1783
+ if attrs[cur].derivation != Derivation.FILTER:
1784
+ stack.extend(lineage_predecessors(graph, edges, cur))
1785
+ return False
1786
+
1787
+
1742
1788
  def _barrier_at_gate_grain(
1743
1789
  graph: nx.DiGraph,
1744
1790
  attrs: dict[str, ConceptAttrs],
@@ -1761,6 +1807,25 @@ def _barrier_at_gate_grain(
1761
1807
  )
1762
1808
 
1763
1809
 
1810
+ def _groups_rows(
1811
+ graph: nx.DiGraph,
1812
+ edges: EdgeMap,
1813
+ attrs: dict[str, ConceptAttrs],
1814
+ node: str,
1815
+ environment: BuildEnvironment,
1816
+ ) -> bool:
1817
+ """An output that is, filters or reads a grouped value (351815, 218754)."""
1818
+ if attrs[node].derivation in AGGREGATING_DERIVATIONS:
1819
+ return True
1820
+ lineage = environment.concepts[attrs[node].address].lineage
1821
+ if isinstance(lineage, BuildFilterItem):
1822
+ return (
1823
+ isinstance(lineage.content, BuildConcept)
1824
+ and lineage.content.derivation in AGGREGATING_DERIVATIONS
1825
+ )
1826
+ return _reads_an_aggregate(graph, edges, attrs, node)
1827
+
1828
+
1764
1829
  def _shown_filter_contents(
1765
1830
  shown: Collection[str],
1766
1831
  attrs: dict[str, ConceptAttrs],
@@ -3111,6 +3176,18 @@ def build_concept_graph(
3111
3176
  )
3112
3177
  }
3113
3178
  backfill += sorted(through_condition)
3179
+ # a window over the select's own groups, or beside a value read off them,
3180
+ # numbers those, not rows
3181
+ off_gate_keys = [
3182
+ src
3183
+ for src in eligible
3184
+ if src not in backfill and _windows_off_gate_keys(graph, edges, attrs, src)
3185
+ ]
3186
+ if off_gate_keys and not any(
3187
+ n in attrs and _groups_rows(graph, edges, attrs, n, environment)
3188
+ for n in mandatory_blank_ids
3189
+ ):
3190
+ backfill += sorted(off_gate_keys)
3114
3191
  # a constant is the same value on every row: the rowed outputs carry a
3115
3192
  # condition its grain has no key for, which it would join on no key (`4`
3116
3193
  # at `big, city` beside `min(height) by species`). Constrained by some of