pytrilogy 0.0.3.30__tar.gz → 0.0.3.32__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.30/pytrilogy.egg-info → pytrilogy-0.0.3.32}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/pytrilogy.egg-info/SOURCES.txt +1 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_environment.py +57 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/enums.py +2 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/environment_helpers.py +25 -1
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/author.py +7 -2
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/environment.py +1 -1
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/duckdb.py +1 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/parse_engine.py +1 -1
- pytrilogy-0.0.3.32/trilogy/std/display.preql +3 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/README.md +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/setup.cfg +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/setup.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_query_render.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_typing.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_user_functions.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/authoring/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/compiler.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/models/execute.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/optimizations/inline_constant.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/dataframe.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/executor.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/render.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/std/__init__.py +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/std/dashboard.preql +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/std/date.preql +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/std/geography.preql +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/std/money.preql +0 -0
- {pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/utility.py +0 -0
|
@@ -13,6 +13,63 @@ from trilogy.core.models.core import DataType
|
|
|
13
13
|
from trilogy.core.models.environment import Environment, LazyEnvironment
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
def test_concept_rehydration():
|
|
17
|
+
test = {
|
|
18
|
+
"name": "order_timestamp.month_start",
|
|
19
|
+
"datatype": "date",
|
|
20
|
+
"purpose": "property",
|
|
21
|
+
"derivation": "root",
|
|
22
|
+
"granularity": "multi_row",
|
|
23
|
+
"metadata": {
|
|
24
|
+
"description": "Auto-derived from a local.order_timestamp. The date truncated to the month.",
|
|
25
|
+
"line_number": None,
|
|
26
|
+
"concept_source": "auto_derived",
|
|
27
|
+
},
|
|
28
|
+
"lineage": {
|
|
29
|
+
"operator": "date_truncate",
|
|
30
|
+
"arg_count": 2,
|
|
31
|
+
"output_datatype": "date",
|
|
32
|
+
"output_purpose": "property",
|
|
33
|
+
"valid_inputs": [
|
|
34
|
+
["datetime", "string", "timestamp", "date"],
|
|
35
|
+
["date_part"],
|
|
36
|
+
],
|
|
37
|
+
"arguments": [
|
|
38
|
+
{
|
|
39
|
+
"address": "local.order_timestamp",
|
|
40
|
+
"datatype": "timestamp",
|
|
41
|
+
"metadata": {
|
|
42
|
+
"description": None,
|
|
43
|
+
"line_number": None,
|
|
44
|
+
"concept_source": "manual",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"month",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
"namespace": "local",
|
|
51
|
+
"keys": ["local.order_timestamp"],
|
|
52
|
+
"grain": {"components": ["local.order_id"], "where_clause": None},
|
|
53
|
+
"modifiers": [],
|
|
54
|
+
"pseudonyms": [],
|
|
55
|
+
}
|
|
56
|
+
Concept.model_validate(test)
|
|
57
|
+
test["lineage"]["arguments"] = [
|
|
58
|
+
{
|
|
59
|
+
"address": "local.order_timestamp",
|
|
60
|
+
"datatype": "timestamp",
|
|
61
|
+
"metadata": {
|
|
62
|
+
"description": None,
|
|
63
|
+
"line_number": None,
|
|
64
|
+
"concept_source": "manual",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
"monthz",
|
|
68
|
+
]
|
|
69
|
+
with raises(TypeError):
|
|
70
|
+
Concept.model_validate(test)
|
|
71
|
+
|
|
72
|
+
|
|
16
73
|
def test_environment_serialization(test_environment: Environment):
|
|
17
74
|
|
|
18
75
|
path = test_environment.to_cache()
|
|
@@ -287,6 +287,8 @@ class ComparisonOperator(Enum):
|
|
|
287
287
|
return ComparisonOperator.IS_NOT
|
|
288
288
|
if value == ["in"]:
|
|
289
289
|
return ComparisonOperator.IN
|
|
290
|
+
if str(value).lower() != str(value):
|
|
291
|
+
return ComparisonOperator(str(value).lower())
|
|
290
292
|
return super()._missing_(str(value).lower())
|
|
291
293
|
|
|
292
294
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from trilogy.constants import DEFAULT_NAMESPACE
|
|
2
|
-
from trilogy.core.enums import ConceptSource, FunctionType, Purpose
|
|
2
|
+
from trilogy.core.enums import ConceptSource, DatePart, FunctionType, Purpose
|
|
3
3
|
from trilogy.core.functions import AttrAccess, FunctionFactory
|
|
4
4
|
from trilogy.core.models.author import Concept, Function, Metadata
|
|
5
5
|
from trilogy.core.models.core import DataType, StructType, arg_to_datatype
|
|
@@ -64,6 +64,30 @@ def generate_date_concepts(concept: Concept, environment: Environment):
|
|
|
64
64
|
if new_concept.name in environment.concepts:
|
|
65
65
|
continue
|
|
66
66
|
environment.add_concept(new_concept, add_derived=False)
|
|
67
|
+
for grain in [DatePart.MONTH, DatePart.YEAR]:
|
|
68
|
+
function = factory.create_function(
|
|
69
|
+
operator=FunctionType.DATE_TRUNCATE,
|
|
70
|
+
args=[concept, grain],
|
|
71
|
+
)
|
|
72
|
+
new_concept = Concept(
|
|
73
|
+
name=f"{concept.name}.{grain.value}_start",
|
|
74
|
+
datatype=DataType.DATE,
|
|
75
|
+
purpose=Purpose.PROPERTY,
|
|
76
|
+
lineage=function,
|
|
77
|
+
grain=concept.grain,
|
|
78
|
+
namespace=concept.namespace,
|
|
79
|
+
keys=set(
|
|
80
|
+
[concept.address],
|
|
81
|
+
),
|
|
82
|
+
metadata=Metadata(
|
|
83
|
+
description=f"Auto-derived from {base_description}. The date truncated to the {grain.value}.",
|
|
84
|
+
line_number=base_line_number,
|
|
85
|
+
concept_source=ConceptSource.AUTO_DERIVED,
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
if new_concept.name in environment.concepts:
|
|
89
|
+
continue
|
|
90
|
+
environment.add_concept(new_concept, add_derived=False)
|
|
67
91
|
|
|
68
92
|
|
|
69
93
|
def generate_datetime_concepts(concept: Concept, environment: Environment):
|
|
@@ -1658,8 +1658,13 @@ class Function(DataTyped, ConceptArgs, Mergeable, Namespaced, BaseModel):
|
|
|
1658
1658
|
# attempt to exit early to avoid checking all types
|
|
1659
1659
|
break
|
|
1660
1660
|
elif isinstance(arg, ptype):
|
|
1661
|
+
if isinstance(arg, str) and DataType.DATE_PART in valid_inputs[idx]:
|
|
1662
|
+
if arg not in [x.value for x in DatePart]:
|
|
1663
|
+
pass
|
|
1664
|
+
else:
|
|
1665
|
+
break
|
|
1661
1666
|
raise TypeError(
|
|
1662
|
-
f
|
|
1667
|
+
f'Invalid {dtype} constant passed into {operator_name} "{arg}", expecting one of {valid_inputs[idx]}'
|
|
1663
1668
|
)
|
|
1664
1669
|
return v
|
|
1665
1670
|
|
|
@@ -2362,6 +2367,7 @@ FuncArgs = (
|
|
|
2362
2367
|
| FilterItem
|
|
2363
2368
|
| int
|
|
2364
2369
|
| float
|
|
2370
|
+
| DatePart
|
|
2365
2371
|
| str
|
|
2366
2372
|
| date
|
|
2367
2373
|
| datetime
|
|
@@ -2371,7 +2377,6 @@ FuncArgs = (
|
|
|
2371
2377
|
| ListType
|
|
2372
2378
|
| MapType
|
|
2373
2379
|
| NumericType
|
|
2374
|
-
| DatePart
|
|
2375
2380
|
| list
|
|
2376
2381
|
| ListWrapper[Any]
|
|
2377
2382
|
)
|
|
@@ -250,7 +250,7 @@ class Environment(BaseModel):
|
|
|
250
250
|
imports=dict(self.imports),
|
|
251
251
|
namespace=self.namespace,
|
|
252
252
|
working_path=self.working_path,
|
|
253
|
-
environment_config=self.config,
|
|
253
|
+
environment_config=self.config.model_copy(deep=True),
|
|
254
254
|
version=self.version,
|
|
255
255
|
cte_name_map=dict(self.cte_name_map),
|
|
256
256
|
materialized_concepts=set(self.materialized_concepts),
|
|
@@ -27,6 +27,7 @@ FUNCTION_MAP = {
|
|
|
27
27
|
FunctionType.INDEX_ACCESS: lambda args: (f"{args[0]}[{args[1]}]"),
|
|
28
28
|
# datetime is aliased
|
|
29
29
|
FunctionType.CURRENT_DATETIME: lambda x: "cast(get_current_timestamp() as datetime)",
|
|
30
|
+
FunctionType.DATE: lambda x: f"cast({x[0]} as date)",
|
|
30
31
|
FunctionType.DATE_TRUNCATE: lambda x: f"date_trunc('{x[1]}', {x[0]})",
|
|
31
32
|
FunctionType.DATE_ADD: lambda x: f"date_add({x[0]}, {x[2]} * INTERVAL 1 {x[1]})",
|
|
32
33
|
FunctionType.DATE_PART: lambda x: f"date_part('{x[1]}', {x[0]})",
|
|
@@ -961,7 +961,7 @@ class ParseToObjects(Transformer):
|
|
|
961
961
|
lookup = address
|
|
962
962
|
if lookup not in self.environment.config.import_resolver.content:
|
|
963
963
|
raise ImportError(
|
|
964
|
-
f"Unable to import file {lookup}, not
|
|
964
|
+
f"Unable to import file {lookup}, not resolvable from provided source files."
|
|
965
965
|
)
|
|
966
966
|
text = self.environment.config.import_resolver.content[lookup]
|
|
967
967
|
else:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/node_merge_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/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.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.30 → pytrilogy-0.0.3.32}/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
|