pytrilogy 0.0.2.14__tar.gz → 0.0.2.17__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.2.14/pytrilogy.egg-info → pytrilogy-0.0.2.17}/PKG-INFO +1 -1
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/models.py +16 -12
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/filter_node.py +1 -1
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/rowset_node.py +14 -4
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/base.py +1 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/common.py +65 -10
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/executor.py +5 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/parse_engine.py +1 -1
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/render.py +2 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/trilogy.lark +4 -2
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/LICENSE.md +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/README.md +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/pyproject.toml +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/setup.cfg +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/setup.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_models.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_select.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/compiler.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/optimizations/inline_constant.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/utility.py +0 -0
|
@@ -2660,9 +2660,9 @@ class CTE(BaseModel):
|
|
|
2660
2660
|
if isinstance(join, InstantiatedUnnestJoin):
|
|
2661
2661
|
continue
|
|
2662
2662
|
if join.left_cte.name == parent.name:
|
|
2663
|
-
join.
|
|
2663
|
+
join.inline_cte(parent)
|
|
2664
2664
|
if join.right_cte.name == parent.name:
|
|
2665
|
-
join.
|
|
2665
|
+
join.inline_cte(parent)
|
|
2666
2666
|
for k, v in self.source_map.items():
|
|
2667
2667
|
if isinstance(v, list):
|
|
2668
2668
|
self.source_map[k] = [
|
|
@@ -2885,34 +2885,38 @@ class JoinKey(BaseModel):
|
|
|
2885
2885
|
|
|
2886
2886
|
|
|
2887
2887
|
class Join(BaseModel):
|
|
2888
|
-
left_cte: CTE
|
|
2889
|
-
right_cte: CTE
|
|
2888
|
+
left_cte: CTE
|
|
2889
|
+
right_cte: CTE
|
|
2890
2890
|
jointype: JoinType
|
|
2891
2891
|
joinkeys: List[JoinKey]
|
|
2892
2892
|
joinkey_pairs: List[ConceptPair] | None = None
|
|
2893
|
+
inlined_ctes: set[str] = Field(default_factory=set)
|
|
2894
|
+
|
|
2895
|
+
def inline_cte(self, cte: CTE):
|
|
2896
|
+
self.inlined_ctes.add(cte.name)
|
|
2893
2897
|
|
|
2894
2898
|
@property
|
|
2895
2899
|
def left_name(self) -> str:
|
|
2896
|
-
if
|
|
2897
|
-
return self.left_cte.identifier
|
|
2900
|
+
if self.left_cte.name in self.inlined_ctes:
|
|
2901
|
+
return self.left_cte.source.datasources[0].identifier
|
|
2898
2902
|
return self.left_cte.name
|
|
2899
2903
|
|
|
2900
2904
|
@property
|
|
2901
2905
|
def right_name(self) -> str:
|
|
2902
|
-
if
|
|
2903
|
-
return self.right_cte.identifier
|
|
2906
|
+
if self.right_cte.name in self.inlined_ctes:
|
|
2907
|
+
return self.right_cte.source.datasources[0].identifier
|
|
2904
2908
|
return self.right_cte.name
|
|
2905
2909
|
|
|
2906
2910
|
@property
|
|
2907
2911
|
def left_ref(self) -> str:
|
|
2908
|
-
if
|
|
2909
|
-
return f"{self.left_cte.safe_location} as {self.left_cte.identifier}"
|
|
2912
|
+
if self.left_cte.name in self.inlined_ctes:
|
|
2913
|
+
return f"{self.left_cte.source.datasources[0].safe_location} as {self.left_cte.source.datasources[0].identifier}"
|
|
2910
2914
|
return self.left_cte.name
|
|
2911
2915
|
|
|
2912
2916
|
@property
|
|
2913
2917
|
def right_ref(self) -> str:
|
|
2914
|
-
if
|
|
2915
|
-
return f"{self.right_cte.safe_location} as {self.right_cte.identifier}"
|
|
2918
|
+
if self.right_cte.name in self.inlined_ctes:
|
|
2919
|
+
return f"{self.right_cte.source.datasources[0].safe_location} as {self.right_cte.source.datasources[0].identifier}"
|
|
2916
2920
|
return self.right_cte.name
|
|
2917
2921
|
|
|
2918
2922
|
@property
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/rowset_node.py
RENAMED
|
@@ -71,12 +71,22 @@ def gen_rowset_node(
|
|
|
71
71
|
and x.derivation != PurposeLineage.ROWSET
|
|
72
72
|
]
|
|
73
73
|
node.hide_output_concepts(final_hidden)
|
|
74
|
-
# assume grain to be output of select
|
|
75
|
-
# but don't include anything aggregate at this point
|
|
76
|
-
assert node.resolution_cache
|
|
77
74
|
|
|
75
|
+
assert node.resolution_cache
|
|
76
|
+
# assume grain to be output of select
|
|
77
|
+
# but don't include anything hidden(the non-rowset concepts)
|
|
78
78
|
node.grain = concept_list_to_grain(
|
|
79
|
-
|
|
79
|
+
[
|
|
80
|
+
x
|
|
81
|
+
for x in node.output_concepts
|
|
82
|
+
if x.address
|
|
83
|
+
not in [
|
|
84
|
+
y.address
|
|
85
|
+
for y in node.hidden_concepts
|
|
86
|
+
if y.derivation != PurposeLineage.ROWSET
|
|
87
|
+
]
|
|
88
|
+
],
|
|
89
|
+
parent_sources=node.resolution_cache.datasources,
|
|
80
90
|
)
|
|
81
91
|
|
|
82
92
|
node.rebuild_cache()
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
from trilogy.core.models import
|
|
1
|
+
from trilogy.core.models import (
|
|
2
|
+
Join,
|
|
3
|
+
InstantiatedUnnestJoin,
|
|
4
|
+
CTE,
|
|
5
|
+
Concept,
|
|
6
|
+
Function,
|
|
7
|
+
RawColumnExpr,
|
|
8
|
+
)
|
|
2
9
|
from trilogy.core.enums import UnnestMode, Modifier
|
|
3
|
-
from typing import
|
|
10
|
+
from typing import Callable
|
|
4
11
|
|
|
5
12
|
|
|
6
13
|
def null_wrapper(lval: str, rval: str, modifiers: list[Modifier]) -> str:
|
|
@@ -21,19 +28,39 @@ def render_unnest(
|
|
|
21
28
|
return f"{render_func(concept, cte, False)} as unnest_wrapper ({quote_character}{concept.safe_address}{quote_character})"
|
|
22
29
|
|
|
23
30
|
|
|
31
|
+
def render_join_concept(
|
|
32
|
+
name: str,
|
|
33
|
+
quote_character: str,
|
|
34
|
+
cte: CTE,
|
|
35
|
+
concept: Concept,
|
|
36
|
+
render_expr,
|
|
37
|
+
inlined_ctes: set[str],
|
|
38
|
+
):
|
|
39
|
+
if cte.name in inlined_ctes:
|
|
40
|
+
ds = cte.source.datasources[0]
|
|
41
|
+
raw_content = ds.get_alias(concept)
|
|
42
|
+
if isinstance(raw_content, RawColumnExpr):
|
|
43
|
+
rval = raw_content.text
|
|
44
|
+
return rval
|
|
45
|
+
elif isinstance(raw_content, Function):
|
|
46
|
+
rval = render_expr(raw_content, cte=cte)
|
|
47
|
+
return rval
|
|
48
|
+
return f"{name}.{quote_character}{raw_content}{quote_character}"
|
|
49
|
+
return f"{name}.{quote_character}{concept.safe_address}{quote_character}"
|
|
50
|
+
|
|
51
|
+
|
|
24
52
|
def render_join(
|
|
25
53
|
join: Join | InstantiatedUnnestJoin,
|
|
26
54
|
quote_character: str,
|
|
27
|
-
render_func:
|
|
28
|
-
|
|
55
|
+
render_func: Callable[[Concept, CTE, bool], str],
|
|
56
|
+
render_expr_func: Callable[[Concept, CTE], str],
|
|
57
|
+
cte: CTE,
|
|
29
58
|
unnest_mode: UnnestMode = UnnestMode.CROSS_APPLY,
|
|
30
59
|
) -> str | None:
|
|
31
60
|
# {% for key in join.joinkeys %}{{ key.inner }} = {{ key.outer}}{% endfor %}
|
|
32
61
|
if isinstance(join, InstantiatedUnnestJoin):
|
|
33
62
|
if unnest_mode == UnnestMode.DIRECT:
|
|
34
63
|
return None
|
|
35
|
-
if not render_func:
|
|
36
|
-
raise ValueError("must provide a render function to build an unnest joins")
|
|
37
64
|
if not cte:
|
|
38
65
|
raise ValueError("must provide a cte to build an unnest joins")
|
|
39
66
|
if unnest_mode == UnnestMode.CROSS_JOIN:
|
|
@@ -46,8 +73,22 @@ def render_join(
|
|
|
46
73
|
right_base = join.right_ref
|
|
47
74
|
base_joinkeys = [
|
|
48
75
|
null_wrapper(
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
render_join_concept(
|
|
77
|
+
left_name,
|
|
78
|
+
quote_character,
|
|
79
|
+
join.left_cte,
|
|
80
|
+
key.concept,
|
|
81
|
+
render_expr_func,
|
|
82
|
+
join.inlined_ctes,
|
|
83
|
+
),
|
|
84
|
+
render_join_concept(
|
|
85
|
+
right_name,
|
|
86
|
+
quote_character,
|
|
87
|
+
join.right_cte,
|
|
88
|
+
key.concept,
|
|
89
|
+
render_expr_func,
|
|
90
|
+
join.inlined_ctes,
|
|
91
|
+
),
|
|
51
92
|
modifiers=key.concept.modifiers or [],
|
|
52
93
|
)
|
|
53
94
|
for key in join.joinkeys
|
|
@@ -56,8 +97,22 @@ def render_join(
|
|
|
56
97
|
base_joinkeys.extend(
|
|
57
98
|
[
|
|
58
99
|
null_wrapper(
|
|
59
|
-
|
|
60
|
-
|
|
100
|
+
render_join_concept(
|
|
101
|
+
left_name,
|
|
102
|
+
quote_character,
|
|
103
|
+
join.left_cte,
|
|
104
|
+
pair.left,
|
|
105
|
+
render_expr_func,
|
|
106
|
+
join.inlined_ctes,
|
|
107
|
+
),
|
|
108
|
+
render_join_concept(
|
|
109
|
+
right_name,
|
|
110
|
+
quote_character,
|
|
111
|
+
join.right_cte,
|
|
112
|
+
pair.right,
|
|
113
|
+
render_expr_func,
|
|
114
|
+
join.inlined_ctes,
|
|
115
|
+
),
|
|
61
116
|
modifiers=pair.modifiers
|
|
62
117
|
+ (pair.left.modifiers or [])
|
|
63
118
|
+ (pair.right.modifiers or []),
|
|
@@ -129,6 +129,11 @@ class Executor(object):
|
|
|
129
129
|
["name"],
|
|
130
130
|
)
|
|
131
131
|
|
|
132
|
+
@execute_query.register
|
|
133
|
+
def _(self, query: str) -> CursorResult:
|
|
134
|
+
|
|
135
|
+
return self.execute_text(query)[-1]
|
|
136
|
+
|
|
132
137
|
@execute_query.register
|
|
133
138
|
def _(self, query: SelectStatement) -> CursorResult:
|
|
134
139
|
sql = self.generator.generate_queries(
|
|
@@ -600,7 +600,7 @@ class ParseToObjects(Transformer):
|
|
|
600
600
|
return args[3:-3]
|
|
601
601
|
|
|
602
602
|
def raw_column_assignment(self, args):
|
|
603
|
-
return RawColumnExpr(text=args[
|
|
603
|
+
return RawColumnExpr(text=args[1])
|
|
604
604
|
|
|
605
605
|
@v_args(meta=True)
|
|
606
606
|
def datasource(self, meta: Meta, args):
|
|
@@ -328,6 +328,8 @@ class Renderer:
|
|
|
328
328
|
inputs = ",".join(self.to_string(c) for c in arg.arguments)
|
|
329
329
|
if arg.operator == FunctionType.CONSTANT:
|
|
330
330
|
return f"{inputs}"
|
|
331
|
+
if arg.operator == FunctionType.INDEX_ACCESS:
|
|
332
|
+
return f"{self.to_string(arg.arguments[0])}[{self.to_string(arg.arguments[1])}]"
|
|
331
333
|
return f"{arg.operator.value}({inputs})"
|
|
332
334
|
|
|
333
335
|
@to_string.register
|
|
@@ -47,9 +47,11 @@
|
|
|
47
47
|
|
|
48
48
|
//column_assignment
|
|
49
49
|
//figure out if we want static
|
|
50
|
-
column_assignment: (
|
|
50
|
+
column_assignment: (raw_column_assignment | IDENTIFIER | _static_functions ) ":" concept_assignment
|
|
51
|
+
|
|
52
|
+
RAW_ENTRY.1: /raw\s*\(/s
|
|
51
53
|
|
|
52
|
-
raw_column_assignment:
|
|
54
|
+
raw_column_assignment: RAW_ENTRY MULTILINE_STRING ")"
|
|
53
55
|
|
|
54
56
|
column_assignment_list : column_assignment ("," column_assignment)* ","?
|
|
55
57
|
|
|
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.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/node_merge_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.14 → pytrilogy-0.0.2.17}/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
|