pytrilogy 0.0.3.110__tar.gz → 0.0.3.112__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.112}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/execute.py +2 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/discovery_utility.py +4 -2
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/basic_node.py +3 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/multiselect_node.py +2 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/base_node.py +3 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/merge_node.py +1 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/query_processor.py +1 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/common.py +2 -1
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/dataframe.py +3 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/engine.py +6 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/executor.py +21 -3
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/README.md +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/requirements.txt +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/setup.cfg +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_execute_models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_failure.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_parsing_failures.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_query_render.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_typing.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_user_functions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_validators.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/constants.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/conversation.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/execute.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/prompts.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/providers/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/providers/anthropic.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/providers/base.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/providers/google.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/providers/openai.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/ai/providers/utils.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/authoring/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/author.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/models/environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimizations/hide_unused_concept.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/discovery_node_factory.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/discovery_validation.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/constant_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/recursive_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/recursive_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/utility.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/validation/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/validation/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/validation/concept.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/validation/datasource.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/validation/environment.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/validation/fix.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/metadata.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/parse_engine.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/render.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/__init__.py +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/color.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/date.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/display.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/geography.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/metric.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/money.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/net.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/ranking.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/std/report.preql +0 -0
- {pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/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)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import List
|
|
2
2
|
|
|
3
3
|
from trilogy.constants import logger
|
|
4
|
-
from trilogy.core.enums import Derivation, Purpose
|
|
4
|
+
from trilogy.core.enums import Derivation, Purpose, SourceType
|
|
5
5
|
from trilogy.core.models.build import (
|
|
6
6
|
BuildConcept,
|
|
7
7
|
BuildDatasource,
|
|
@@ -200,8 +200,10 @@ def group_if_required_v2(
|
|
|
200
200
|
root.set_output_concepts(targets, rebuild=False, change_visibility=False)
|
|
201
201
|
root.rebuild_cache()
|
|
202
202
|
return root
|
|
203
|
+
elif isinstance(root, GroupNode) and root.source_type == SourceType.BASIC:
|
|
204
|
+
# we need to group this one more time
|
|
205
|
+
pass
|
|
203
206
|
elif isinstance(root, GroupNode):
|
|
204
|
-
|
|
205
207
|
if set(x.address for x in final) != set(
|
|
206
208
|
x.address for x in root.output_concepts
|
|
207
209
|
):
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
@@ -138,7 +138,9 @@ def gen_basic_node(
|
|
|
138
138
|
for s in parent_node.output_concepts
|
|
139
139
|
if any(s.address in y.pseudonyms for y in targets)
|
|
140
140
|
] + targets
|
|
141
|
-
parent_node.
|
|
141
|
+
hidden = [x for x in parent_node.output_concepts if x.address not in targets]
|
|
142
|
+
parent_node.hide_output_concepts(hidden)
|
|
143
|
+
parent_node.source_type = SourceType.BASIC
|
|
142
144
|
|
|
143
145
|
logger.info(
|
|
144
146
|
f"{depth_prefix}{LOGGER_PREFIX} Returning basic select for {concept}: input: {[x.address for x in parent_node.input_concepts]} output {[x.address for x in parent_node.output_concepts]} hidden {[x for x in parent_node.hidden_concepts]}"
|
|
@@ -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,24 @@ 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 gc
|
|
86
|
+
|
|
87
|
+
gc.collect()
|
|
88
|
+
self.connected = False
|
|
89
|
+
|
|
77
90
|
def execute_statement(
|
|
78
91
|
self,
|
|
79
92
|
statement: PROCESSED_STATEMENT_TYPES,
|
|
@@ -244,7 +257,9 @@ class Executor(object):
|
|
|
244
257
|
"""generate SQL for execution"""
|
|
245
258
|
_, parsed = parse_text(command, self.environment)
|
|
246
259
|
generatable = [
|
|
247
|
-
x
|
|
260
|
+
x
|
|
261
|
+
for x in parsed
|
|
262
|
+
if isinstance(x, (SelectStatement, PersistStatement, MultiSelectStatement))
|
|
248
263
|
]
|
|
249
264
|
sql = self.generator.generate_queries(
|
|
250
265
|
self.environment, generatable, hooks=self.hooks
|
|
@@ -419,6 +434,9 @@ class Executor(object):
|
|
|
419
434
|
def execute_text(
|
|
420
435
|
self, command: str, non_interactive: bool = False
|
|
421
436
|
) -> List[ResultProtocol]:
|
|
437
|
+
if not self.connected:
|
|
438
|
+
self.connect()
|
|
439
|
+
|
|
422
440
|
"""Run a trilogy query expressed as text."""
|
|
423
441
|
output: list[ResultProtocol] = []
|
|
424
442
|
# 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.112}/trilogy/core/optimizations/hide_unused_concept.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/optimizations/predicate_pushdown.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/concept_strategies_v3.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/discovery_node_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/common.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/constant_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/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.112}/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.112}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.110 → pytrilogy-0.0.3.112}/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
|