pytrilogy 0.0.1.114__tar.gz → 0.0.1.115__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.1.114/pytrilogy.egg-info → pytrilogy-0.0.1.115}/PKG-INFO +1 -1
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_parsing.py +29 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/models.py +3 -1
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/parse_engine.py +6 -3
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/LICENSE.md +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/README.md +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/pyproject.toml +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/setup.cfg +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/setup.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_models.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_select.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/compiler.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/concept_merge_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/executor.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/utility.py +0 -0
|
@@ -263,3 +263,32 @@ def test_the_comments():
|
|
|
263
263
|
assert isinstance(right, MagicConstants), type(right)
|
|
264
264
|
rendered = BaseDialect().render_expr(right)
|
|
265
265
|
assert rendered == "null"
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def test_purpose_nesting():
|
|
269
|
+
|
|
270
|
+
env, parsed = parse_text(
|
|
271
|
+
"""key year int;
|
|
272
|
+
"""
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
env2: Environment = Environment()
|
|
276
|
+
env2.add_import("dates", env)
|
|
277
|
+
|
|
278
|
+
env2, _ = parse_text(
|
|
279
|
+
"""
|
|
280
|
+
property <dates.year>.generation <-
|
|
281
|
+
CASE WHEN dates.year BETWEEN 1883 AND 1900 THEN 'Lost Generation'
|
|
282
|
+
WHEN dates.year BETWEEN 1901 AND 1927 THEN 'The Greatest Generation'
|
|
283
|
+
WHEN dates.year BETWEEN 1928 AND 1945 THEN 'The Silent Generation'
|
|
284
|
+
WHEN dates.year BETWEEN 1946 AND 1964 THEN 'Baby Boomer'
|
|
285
|
+
WHEN dates.year BETWEEN 1965 AND 1980 THEN 'Generation X'
|
|
286
|
+
WHEN dates.year BETWEEN 1981 AND 1996 THEN 'Millennials'
|
|
287
|
+
WHEN dates.year BETWEEN 1997 AND 2012 THEN 'Generation Z'
|
|
288
|
+
ELSE 'Unknown'
|
|
289
|
+
END;
|
|
290
|
+
""",
|
|
291
|
+
env2,
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
assert env2.concepts["dates.generation"].purpose == Purpose.PROPERTY
|
|
@@ -2669,7 +2669,8 @@ class Environment(BaseModel):
|
|
|
2669
2669
|
|
|
2670
2670
|
|
|
2671
2671
|
class LazyEnvironment(Environment):
|
|
2672
|
-
"""Variant of environment to defer parsing of a path
|
|
2672
|
+
"""Variant of environment to defer parsing of a path
|
|
2673
|
+
until relevant attributes accessed."""
|
|
2673
2674
|
|
|
2674
2675
|
load_path: Path
|
|
2675
2676
|
loaded: bool = False
|
|
@@ -2681,6 +2682,7 @@ class LazyEnvironment(Environment):
|
|
|
2681
2682
|
"working_path",
|
|
2682
2683
|
"model_config",
|
|
2683
2684
|
"model_fields",
|
|
2685
|
+
"model_post_init",
|
|
2684
2686
|
) or name.startswith("_"):
|
|
2685
2687
|
return super().__getattribute__(name)
|
|
2686
2688
|
if not self.loaded:
|
|
@@ -465,16 +465,19 @@ class ParseToObjects(Transformer):
|
|
|
465
465
|
if purpose == Purpose.AUTO:
|
|
466
466
|
purpose = None
|
|
467
467
|
raw_name = args[1]
|
|
468
|
+
# abc.def.property pattern
|
|
468
469
|
if isinstance(raw_name, str):
|
|
469
470
|
lookup, namespace, name, parent_concept = parse_concept_reference(
|
|
470
471
|
raw_name, self.environment, purpose
|
|
471
472
|
)
|
|
473
|
+
# <abc.def,zef.gf>.property pattern
|
|
472
474
|
else:
|
|
473
475
|
keys, name = raw_name
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
else:
|
|
476
|
+
namespaces = set([x.namespace for x in keys])
|
|
477
|
+
if not len(namespaces) == 1:
|
|
477
478
|
namespace = self.environment.namespace or DEFAULT_NAMESPACE
|
|
479
|
+
else:
|
|
480
|
+
namespace = namespaces.pop()
|
|
478
481
|
source_value = args[2]
|
|
479
482
|
# we need to strip off every parenthetical to see what is being assigned.
|
|
480
483
|
while isinstance(source_value, Parenthetical):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/concept_strategies_v3.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/rowset_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.1.114 → pytrilogy-0.0.1.115}/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
|