pytrilogy 0.0.3.110__tar.gz → 0.0.3.111__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.
Potentially problematic release.
This version of pytrilogy might be problematic. Click here for more details.
- {pytrilogy-0.0.3.110/pytrilogy.egg-info → pytrilogy-0.0.3.111}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/execute.py +2 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/multiselect_node.py +2 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/base_node.py +3 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/merge_node.py +1 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/query_processor.py +1 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/common.py +2 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/dataframe.py +3 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/engine.py +6 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/executor.py +24 -3
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/README.md +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/requirements.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/setup.cfg +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_execute_models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_failure.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_parsing_failures.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_query_render.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_typing.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_user_functions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_validators.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/constants.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/conversation.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/execute.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/prompts.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/providers/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/providers/anthropic.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/providers/base.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/providers/google.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/providers/openai.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/ai/providers/utils.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/authoring/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/author.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/models/environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/hide_unused_concept.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/discovery_node_factory.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/discovery_utility.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/discovery_validation.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/constant_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/recursive_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/recursive_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/utility.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/validation/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/validation/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/validation/concept.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/validation/datasource.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/validation/environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/validation/fix.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/metadata.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/parse_engine.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/render.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/color.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/date.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/display.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/geography.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/metric.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/money.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/net.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/ranking.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/std/report.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/utility.py +0 -0
|
@@ -500,6 +500,7 @@ class BaseJoin(BaseModel):
|
|
|
500
500
|
concepts: Optional[List[BuildConcept]] = None
|
|
501
501
|
left_datasource: Optional[Union[BuildDatasource, "QueryDatasource"]] = None
|
|
502
502
|
concept_pairs: list[ConceptPair] | None = None
|
|
503
|
+
modifiers: List[Modifier] = Field(default_factory=list)
|
|
503
504
|
|
|
504
505
|
@model_validator(mode="after")
|
|
505
506
|
def validate_join(self) -> "BaseJoin":
|
|
@@ -1103,6 +1104,7 @@ class Join(BaseModel):
|
|
|
1103
1104
|
inlined_ctes: set[str] = Field(default_factory=set)
|
|
1104
1105
|
quote: str | None = None
|
|
1105
1106
|
condition: BuildConditional | BuildComparison | BuildParenthetical | None = None
|
|
1107
|
+
modifiers: List[Modifier] = Field(default_factory=list)
|
|
1106
1108
|
|
|
1107
1109
|
def inline_cte(self, cte: CTE):
|
|
1108
1110
|
self.inlined_ctes.add(cte.name)
|
|
@@ -3,7 +3,7 @@ from itertools import combinations
|
|
|
3
3
|
from typing import List
|
|
4
4
|
|
|
5
5
|
from trilogy.constants import logger
|
|
6
|
-
from trilogy.core.enums import JoinType, Purpose
|
|
6
|
+
from trilogy.core.enums import JoinType, Modifier, Purpose
|
|
7
7
|
from trilogy.core.models.build import (
|
|
8
8
|
BuildConcept,
|
|
9
9
|
BuildGrain,
|
|
@@ -47,6 +47,7 @@ def extra_align_joins(
|
|
|
47
47
|
right_node=right,
|
|
48
48
|
concepts=matched_concepts,
|
|
49
49
|
join_type=JoinType.FULL,
|
|
50
|
+
modifiers=[Modifier.NULLABLE],
|
|
50
51
|
)
|
|
51
52
|
)
|
|
52
53
|
return resolve_join_order(output)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from collections import defaultdict
|
|
2
|
-
from dataclasses import dataclass
|
|
2
|
+
from dataclasses import dataclass, field
|
|
3
3
|
from typing import List, Optional
|
|
4
4
|
|
|
5
5
|
from trilogy.core.enums import (
|
|
6
6
|
BooleanOperator,
|
|
7
7
|
Derivation,
|
|
8
8
|
JoinType,
|
|
9
|
+
Modifier,
|
|
9
10
|
SourceType,
|
|
10
11
|
)
|
|
11
12
|
from trilogy.core.models.build import (
|
|
@@ -436,6 +437,7 @@ class NodeJoin:
|
|
|
436
437
|
join_type: JoinType
|
|
437
438
|
filter_to_mutual: bool = False
|
|
438
439
|
concept_pairs: list[ConceptPair] | None = None
|
|
440
|
+
modifiers: List[Modifier] = field(default_factory=list)
|
|
439
441
|
|
|
440
442
|
def __post_init__(self):
|
|
441
443
|
if self.left_node == self.right_node:
|
|
@@ -33,6 +33,9 @@ class EngineConnection(Protocol):
|
|
|
33
33
|
def rollback(self):
|
|
34
34
|
raise NotImplementedError()
|
|
35
35
|
|
|
36
|
+
def close(self) -> None:
|
|
37
|
+
return
|
|
38
|
+
|
|
36
39
|
|
|
37
40
|
class ExecutionEngine(Protocol):
|
|
38
41
|
pass
|
|
@@ -43,6 +46,9 @@ class ExecutionEngine(Protocol):
|
|
|
43
46
|
def setup(self, env: Environment, connection):
|
|
44
47
|
pass
|
|
45
48
|
|
|
49
|
+
def dispose(self, close: bool = True):
|
|
50
|
+
pass
|
|
51
|
+
|
|
46
52
|
|
|
47
53
|
### Begin default SQLAlchemy implementation
|
|
48
54
|
class SqlAlchemyResult:
|
|
@@ -47,7 +47,7 @@ from trilogy.dialect.metadata import (
|
|
|
47
47
|
handle_processed_validate_statement,
|
|
48
48
|
handle_show_statement_outputs,
|
|
49
49
|
)
|
|
50
|
-
from trilogy.engine import ExecutionEngine, ResultProtocol
|
|
50
|
+
from trilogy.engine import EngineConnection, ExecutionEngine, ResultProtocol
|
|
51
51
|
from trilogy.hooks.base_hook import BaseHook
|
|
52
52
|
from trilogy.parser import parse_text
|
|
53
53
|
from trilogy.render import get_dialect_generator
|
|
@@ -69,11 +69,27 @@ class Executor(object):
|
|
|
69
69
|
self.logger = logger
|
|
70
70
|
self.hooks = hooks
|
|
71
71
|
self.generator = get_dialect_generator(self.dialect, rendering)
|
|
72
|
-
self.connection = self.
|
|
72
|
+
self.connection = self.connect()
|
|
73
73
|
# TODO: make generic
|
|
74
74
|
if self.dialect == Dialects.DATAFRAME:
|
|
75
75
|
self.engine.setup(self.environment, self.connection)
|
|
76
76
|
|
|
77
|
+
def connect(self) -> EngineConnection:
|
|
78
|
+
self.connection = self.engine.connect()
|
|
79
|
+
self.connected = True
|
|
80
|
+
return self.connection
|
|
81
|
+
|
|
82
|
+
def close(self):
|
|
83
|
+
self.engine.dispose(close=True)
|
|
84
|
+
if self.dialect == Dialects.DUCK_DB:
|
|
85
|
+
import duckdb
|
|
86
|
+
|
|
87
|
+
duckdb.default_connection().close()
|
|
88
|
+
import gc
|
|
89
|
+
|
|
90
|
+
gc.collect()
|
|
91
|
+
self.connected = False
|
|
92
|
+
|
|
77
93
|
def execute_statement(
|
|
78
94
|
self,
|
|
79
95
|
statement: PROCESSED_STATEMENT_TYPES,
|
|
@@ -244,7 +260,9 @@ class Executor(object):
|
|
|
244
260
|
"""generate SQL for execution"""
|
|
245
261
|
_, parsed = parse_text(command, self.environment)
|
|
246
262
|
generatable = [
|
|
247
|
-
x
|
|
263
|
+
x
|
|
264
|
+
for x in parsed
|
|
265
|
+
if isinstance(x, (SelectStatement, PersistStatement, MultiSelectStatement))
|
|
248
266
|
]
|
|
249
267
|
sql = self.generator.generate_queries(
|
|
250
268
|
self.environment, generatable, hooks=self.hooks
|
|
@@ -419,6 +437,9 @@ class Executor(object):
|
|
|
419
437
|
def execute_text(
|
|
420
438
|
self, command: str, non_interactive: bool = False
|
|
421
439
|
) -> List[ResultProtocol]:
|
|
440
|
+
if not self.connected:
|
|
441
|
+
self.connect()
|
|
442
|
+
|
|
422
443
|
"""Run a trilogy query expressed as text."""
|
|
423
444
|
output: list[ResultProtocol] = []
|
|
424
445
|
# connection = self.engine.connect()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/hide_unused_concept.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/optimizations/predicate_pushdown.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/concept_strategies_v3.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/discovery_node_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/common.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/constant_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/rowset_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.111}/trilogy/core/processing/node_generators/window_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|