pytrilogy 0.0.3.3__tar.gz → 0.0.3.4__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.3/pytrilogy.egg-info → pytrilogy-0.0.3.4}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/pytrilogy.egg-info/SOURCES.txt +1 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_datatypes.py +1 -1
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_parsing.py +2 -2
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_where_clause.py +1 -1
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/__init__.py +1 -1
- pytrilogy-0.0.3.4/trilogy/authoring/__init__.py +90 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/common.py +3 -9
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/parse_engine.py +5 -13
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/README.md +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/setup.cfg +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/setup.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/compiler.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/author.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/environment.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/models/execute.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/optimizations/inline_constant.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/executor.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/utility.py +0 -0
|
@@ -9,7 +9,7 @@ from trilogy.parsing.parse_engine import (
|
|
|
9
9
|
|
|
10
10
|
def test_numeric():
|
|
11
11
|
env, _ = parse_text(
|
|
12
|
-
"const order_id numeric(12,2);
|
|
12
|
+
"const order_id numeric(12,2); auto rounded <- cast(order_id as numeric(15,2));"
|
|
13
13
|
)
|
|
14
14
|
assert env.concepts["order_id"].datatype == NumericType(precision=12, scale=2)
|
|
15
15
|
|
|
@@ -323,7 +323,7 @@ def test_circular_aliasing():
|
|
|
323
323
|
property composite_id.first <- split(composite_id, '-')[1];
|
|
324
324
|
property composite_id.second <- split(composite_id, '-')[2];
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
auto composite_id_alt <- concat(first, '-', second);
|
|
327
327
|
|
|
328
328
|
merge composite_id_alt into composite_id;
|
|
329
329
|
|
|
@@ -367,7 +367,7 @@ def test_circular_aliasing_inverse():
|
|
|
367
367
|
property composite_id.first <- split(composite_id, '-')[1];
|
|
368
368
|
property composite_id.second <- split(composite_id, '-')[2];
|
|
369
369
|
|
|
370
|
-
|
|
370
|
+
auto composite_id_alt <- concat(first, '-', second);
|
|
371
371
|
|
|
372
372
|
merge composite_id_alt into composite_id;
|
|
373
373
|
|
|
@@ -89,7 +89,7 @@ select
|
|
|
89
89
|
|
|
90
90
|
def test_select_where_attribute_v2(test_environment):
|
|
91
91
|
declarations = """
|
|
92
|
-
|
|
92
|
+
auto special_category <- filter category_id where like(category_name, '%special%') is True;
|
|
93
93
|
|
|
94
94
|
select
|
|
95
95
|
order_id,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from trilogy.constants import DEFAULT_NAMESPACE
|
|
2
|
+
from trilogy.core.enums import (
|
|
3
|
+
BooleanOperator,
|
|
4
|
+
ComparisonOperator,
|
|
5
|
+
FunctionClass,
|
|
6
|
+
FunctionType,
|
|
7
|
+
InfiniteFunctionArgs,
|
|
8
|
+
Ordering,
|
|
9
|
+
Purpose,
|
|
10
|
+
)
|
|
11
|
+
from trilogy.core.functions import FunctionFactory
|
|
12
|
+
from trilogy.core.models.author import (
|
|
13
|
+
AggregateWrapper,
|
|
14
|
+
CaseElse,
|
|
15
|
+
CaseWhen,
|
|
16
|
+
Comparison,
|
|
17
|
+
Concept,
|
|
18
|
+
ConceptRef,
|
|
19
|
+
Conditional,
|
|
20
|
+
FilterItem,
|
|
21
|
+
Function,
|
|
22
|
+
HavingClause,
|
|
23
|
+
MagicConstants,
|
|
24
|
+
Metadata,
|
|
25
|
+
OrderBy,
|
|
26
|
+
OrderItem,
|
|
27
|
+
Parenthetical,
|
|
28
|
+
SubselectComparison,
|
|
29
|
+
WhereClause,
|
|
30
|
+
WindowItem,
|
|
31
|
+
WindowItemOrder,
|
|
32
|
+
WindowItemOver,
|
|
33
|
+
WindowOrder,
|
|
34
|
+
WindowType,
|
|
35
|
+
)
|
|
36
|
+
from trilogy.core.models.core import DataType, ListType, ListWrapper, StructType
|
|
37
|
+
from trilogy.core.models.environment import Environment
|
|
38
|
+
from trilogy.core.statements.author import (
|
|
39
|
+
ConceptDeclarationStatement,
|
|
40
|
+
ConceptTransform,
|
|
41
|
+
SelectItem,
|
|
42
|
+
SelectStatement,
|
|
43
|
+
)
|
|
44
|
+
from trilogy.parsing.common import arbitrary_to_concept, arg_to_datatype
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"Concept",
|
|
48
|
+
"Function",
|
|
49
|
+
"WhereClause",
|
|
50
|
+
"Comparison",
|
|
51
|
+
"FilterItem",
|
|
52
|
+
"CaseWhen",
|
|
53
|
+
"CaseElse",
|
|
54
|
+
"AggregateWrapper",
|
|
55
|
+
"WindowItem",
|
|
56
|
+
"WindowOrder",
|
|
57
|
+
"WindowType",
|
|
58
|
+
"WindowItemOrder",
|
|
59
|
+
"WindowItemOver",
|
|
60
|
+
"DataType",
|
|
61
|
+
"StructType",
|
|
62
|
+
"ListType",
|
|
63
|
+
"ListWrapper",
|
|
64
|
+
"FunctionType",
|
|
65
|
+
"FunctionFactory",
|
|
66
|
+
"ConceptDeclarationStatement",
|
|
67
|
+
"ConceptTransform",
|
|
68
|
+
"SelectItem",
|
|
69
|
+
"SelectStatement",
|
|
70
|
+
"Environment",
|
|
71
|
+
"ConceptRef",
|
|
72
|
+
"HavingClause",
|
|
73
|
+
"MagicConstants",
|
|
74
|
+
"Metadata",
|
|
75
|
+
"OrderBy",
|
|
76
|
+
"OrderItem",
|
|
77
|
+
"Parenthetical",
|
|
78
|
+
"SubselectComparison",
|
|
79
|
+
"Conditional",
|
|
80
|
+
"BooleanOperator",
|
|
81
|
+
"ComparisonOperator",
|
|
82
|
+
"FunctionClass",
|
|
83
|
+
"FunctionType",
|
|
84
|
+
"InfiniteFunctionArgs",
|
|
85
|
+
"Ordering",
|
|
86
|
+
"Purpose",
|
|
87
|
+
"DEFAULT_NAMESPACE",
|
|
88
|
+
"arbitrary_to_concept",
|
|
89
|
+
"arg_to_datatype",
|
|
90
|
+
]
|
|
@@ -152,7 +152,6 @@ def constant_to_concept(
|
|
|
152
152
|
parent: ListWrapper | MapWrapper | list | int | float | str,
|
|
153
153
|
name: str,
|
|
154
154
|
namespace: str,
|
|
155
|
-
purpose: Purpose | None = None,
|
|
156
155
|
metadata: Metadata | None = None,
|
|
157
156
|
) -> Concept:
|
|
158
157
|
const_function: Function = Function(
|
|
@@ -340,7 +339,6 @@ def filter_item_to_concept(
|
|
|
340
339
|
name: str,
|
|
341
340
|
namespace: str,
|
|
342
341
|
environment: Environment,
|
|
343
|
-
purpose: Purpose | None = None,
|
|
344
342
|
metadata: Metadata | None = None,
|
|
345
343
|
) -> Concept:
|
|
346
344
|
fmetadata = metadata or Metadata()
|
|
@@ -377,14 +375,13 @@ def window_item_to_concept(
|
|
|
377
375
|
name: str,
|
|
378
376
|
namespace: str,
|
|
379
377
|
environment: Environment,
|
|
380
|
-
purpose: Purpose | None = None,
|
|
381
378
|
metadata: Metadata | None = None,
|
|
382
379
|
) -> Concept:
|
|
383
380
|
fmetadata = metadata or Metadata()
|
|
384
381
|
bcontent = environment.concepts[parent.content.address]
|
|
385
382
|
if isinstance(bcontent, UndefinedConcept):
|
|
386
383
|
return UndefinedConcept(address=f"{namespace}.{name}", metadata=fmetadata)
|
|
387
|
-
local_purpose, keys = get_purpose_and_keys(
|
|
384
|
+
local_purpose, keys = get_purpose_and_keys(None, (bcontent,), environment)
|
|
388
385
|
|
|
389
386
|
if parent.order_by:
|
|
390
387
|
grain_components = parent.over + [bcontent.output]
|
|
@@ -568,7 +565,6 @@ def arbitrary_to_concept(
|
|
|
568
565
|
namespace: str | None = None,
|
|
569
566
|
name: str | None = None,
|
|
570
567
|
metadata: Metadata | None = None,
|
|
571
|
-
purpose: Purpose | None = None,
|
|
572
568
|
) -> Concept:
|
|
573
569
|
namespace = namespace or environment.namespace
|
|
574
570
|
if isinstance(parent, AggregateWrapper):
|
|
@@ -585,7 +581,6 @@ def arbitrary_to_concept(
|
|
|
585
581
|
name,
|
|
586
582
|
namespace,
|
|
587
583
|
environment=environment,
|
|
588
|
-
purpose=purpose,
|
|
589
584
|
metadata=metadata,
|
|
590
585
|
)
|
|
591
586
|
elif isinstance(parent, FilterItem):
|
|
@@ -596,7 +591,6 @@ def arbitrary_to_concept(
|
|
|
596
591
|
name,
|
|
597
592
|
namespace,
|
|
598
593
|
environment=environment,
|
|
599
|
-
purpose=purpose,
|
|
600
594
|
metadata=metadata,
|
|
601
595
|
)
|
|
602
596
|
elif isinstance(parent, Function):
|
|
@@ -612,8 +606,8 @@ def arbitrary_to_concept(
|
|
|
612
606
|
elif isinstance(parent, ListWrapper):
|
|
613
607
|
if not name:
|
|
614
608
|
name = f"{VIRTUAL_CONCEPT_PREFIX}_{string_to_hash(str(parent))}"
|
|
615
|
-
return constant_to_concept(parent, name, namespace,
|
|
609
|
+
return constant_to_concept(parent, name, namespace, metadata)
|
|
616
610
|
else:
|
|
617
611
|
if not name:
|
|
618
612
|
name = f"{VIRTUAL_CONCEPT_PREFIX}_{string_to_hash(str(parent))}"
|
|
619
|
-
return constant_to_concept(parent, name, namespace,
|
|
613
|
+
return constant_to_concept(parent, name, namespace, metadata)
|
|
@@ -508,8 +508,6 @@ class ParseToObjects(Transformer):
|
|
|
508
508
|
else:
|
|
509
509
|
metadata = None
|
|
510
510
|
purpose = args[0]
|
|
511
|
-
if purpose == Purpose.AUTO:
|
|
512
|
-
purpose = None
|
|
513
511
|
raw_name = args[1]
|
|
514
512
|
# abc.def.property pattern
|
|
515
513
|
if isinstance(raw_name, str):
|
|
@@ -538,10 +536,14 @@ class ParseToObjects(Transformer):
|
|
|
538
536
|
name=name,
|
|
539
537
|
namespace=namespace,
|
|
540
538
|
environment=self.environment,
|
|
541
|
-
purpose=purpose,
|
|
542
539
|
metadata=metadata,
|
|
543
540
|
)
|
|
544
541
|
|
|
542
|
+
if purpose and purpose != Purpose.AUTO and concept.purpose != purpose:
|
|
543
|
+
raise SyntaxError(
|
|
544
|
+
f'Concept {name} purpose {concept.purpose} does not match declared purpose {purpose}. Suggest defaulting to "auto"'
|
|
545
|
+
)
|
|
546
|
+
|
|
545
547
|
if concept.metadata:
|
|
546
548
|
concept.metadata.line_number = meta.line
|
|
547
549
|
self.environment.add_concept(concept, meta=meta)
|
|
@@ -552,7 +554,6 @@ class ParseToObjects(Transformer):
|
|
|
552
554
|
source_value,
|
|
553
555
|
name=name,
|
|
554
556
|
namespace=namespace,
|
|
555
|
-
purpose=purpose,
|
|
556
557
|
metadata=metadata,
|
|
557
558
|
)
|
|
558
559
|
if concept.metadata:
|
|
@@ -577,15 +578,6 @@ class ParseToObjects(Transformer):
|
|
|
577
578
|
namespace=self.environment.namespace or DEFAULT_NAMESPACE,
|
|
578
579
|
)
|
|
579
580
|
|
|
580
|
-
# clean up current definitions
|
|
581
|
-
# to_delete = set()
|
|
582
|
-
# if output.name in self.environment.named_statements:
|
|
583
|
-
# for k, v in self.environment.concepts.items():
|
|
584
|
-
# if v.derivation == Derivation.ROWSET and v.lineage.rowset.name == name:
|
|
585
|
-
# to_delete.add(k)
|
|
586
|
-
# for k in to_delete:
|
|
587
|
-
# self.environment.concepts.pop(k)
|
|
588
|
-
|
|
589
581
|
for new_concept in rowset_to_concepts(output, self.environment):
|
|
590
582
|
if new_concept.metadata:
|
|
591
583
|
new_concept.metadata.line_number = meta.line
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/multiselect_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/node_merge_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/rowset_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/select_merge_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.3 → pytrilogy-0.0.3.4}/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
|