pytrilogy 0.0.3.106__tar.gz → 0.0.3.107__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.106/pytrilogy.egg-info → pytrilogy-0.0.3.107}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/concept_strategies_v3.py +12 -13
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/discovery_utility.py +22 -3
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/group_node.py +1 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/window_node.py +7 -5
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/group_node.py +7 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/render.py +16 -1
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/README.md +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/setup.cfg +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/setup.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_execute_models.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_failure.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_parsing_failures.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_query_render.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_typing.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_user_functions.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_validators.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/authoring/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/author.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/environment.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/models/execute.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/hide_unused_concept.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/discovery_node_factory.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/discovery_validation.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/constant_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/recursive_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/recursive_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/utility.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/validation/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/validation/common.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/validation/concept.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/validation/datasource.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/validation/environment.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/validation/fix.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/dataframe.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/metadata.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/executor.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/parse_engine.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/render.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/__init__.py +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/color.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/date.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/display.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/geography.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/metric.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/money.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/net.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/ranking.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/std/report.preql +0 -0
- {pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/utility.py +0 -0
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/concept_strategies_v3.py
RENAMED
|
@@ -350,9 +350,6 @@ def check_for_early_exit(
|
|
|
350
350
|
def generate_loop_completion(context: LoopContext, virtual: set[str]) -> StrategyNode:
|
|
351
351
|
condition_required = True
|
|
352
352
|
non_virtual = [c for c in context.completion_mandatory if c.address not in virtual]
|
|
353
|
-
non_virtual_output = [
|
|
354
|
-
c for c in context.original_mandatory if c.address not in virtual
|
|
355
|
-
]
|
|
356
353
|
non_virtual_different = len(context.completion_mandatory) != len(
|
|
357
354
|
context.original_mandatory
|
|
358
355
|
)
|
|
@@ -380,11 +377,12 @@ def generate_loop_completion(context: LoopContext, virtual: set[str]) -> Strateg
|
|
|
380
377
|
logger.info(
|
|
381
378
|
f"Condition {context.conditions} not required, parents included filtering! {parent_map}"
|
|
382
379
|
)
|
|
380
|
+
|
|
383
381
|
if len(context.stack) == 1:
|
|
384
382
|
output: StrategyNode = context.stack[0]
|
|
385
383
|
if non_virtual_different:
|
|
386
384
|
logger.info(
|
|
387
|
-
f"{depth_to_prefix(context.depth)}{LOGGER_PREFIX} Found
|
|
385
|
+
f"{depth_to_prefix(context.depth)}{LOGGER_PREFIX} Found added non-virtual output concepts ({non_virtual_difference_values})"
|
|
388
386
|
)
|
|
389
387
|
# output.set_output_concepts(
|
|
390
388
|
# [
|
|
@@ -398,13 +396,6 @@ def generate_loop_completion(context: LoopContext, virtual: set[str]) -> Strateg
|
|
|
398
396
|
# )
|
|
399
397
|
# output.set_output_concepts(context.original_mandatory)
|
|
400
398
|
|
|
401
|
-
# if isinstance(output, MergeNode):
|
|
402
|
-
# output.force_group = True
|
|
403
|
-
# output.rebuild_cache()
|
|
404
|
-
|
|
405
|
-
logger.info(
|
|
406
|
-
f"{depth_to_prefix(context.depth)}{LOGGER_PREFIX} Source stack has single node, returning that {type(output)}"
|
|
407
|
-
)
|
|
408
399
|
else:
|
|
409
400
|
logger.info(
|
|
410
401
|
f"{depth_to_prefix(context.depth)}{LOGGER_PREFIX} wrapping multiple parent nodes {[type(x) for x in context.stack]} in merge node"
|
|
@@ -441,10 +432,18 @@ def generate_loop_completion(context: LoopContext, virtual: set[str]) -> Strateg
|
|
|
441
432
|
f"{depth_to_prefix(context.depth)}{LOGGER_PREFIX} Conditions {context.conditions} were injected, checking if we need a group to restore grain"
|
|
442
433
|
)
|
|
443
434
|
return group_if_required_v2(
|
|
444
|
-
output,
|
|
435
|
+
output,
|
|
436
|
+
context.original_mandatory,
|
|
437
|
+
context.environment,
|
|
438
|
+
non_virtual_difference_values,
|
|
445
439
|
)
|
|
446
440
|
|
|
447
|
-
return group_if_required_v2(
|
|
441
|
+
return group_if_required_v2(
|
|
442
|
+
output,
|
|
443
|
+
context.original_mandatory,
|
|
444
|
+
context.environment,
|
|
445
|
+
non_virtual_difference_values,
|
|
446
|
+
)
|
|
448
447
|
|
|
449
448
|
|
|
450
449
|
def _search_concepts(
|
|
@@ -180,8 +180,12 @@ def check_if_group_required(
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
def group_if_required_v2(
|
|
183
|
-
root: StrategyNode,
|
|
183
|
+
root: StrategyNode,
|
|
184
|
+
final: List[BuildConcept],
|
|
185
|
+
environment: BuildEnvironment,
|
|
186
|
+
where_injected: set[str] | None = None,
|
|
184
187
|
):
|
|
188
|
+
where_injected = where_injected or set()
|
|
185
189
|
required = check_if_group_required(
|
|
186
190
|
downstream_concepts=final, parents=[root.resolve()], environment=environment
|
|
187
191
|
)
|
|
@@ -197,8 +201,23 @@ def group_if_required_v2(
|
|
|
197
201
|
root.rebuild_cache()
|
|
198
202
|
return root
|
|
199
203
|
elif isinstance(root, GroupNode):
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
|
|
205
|
+
if set(x.address for x in final) != set(
|
|
206
|
+
x.address for x in root.output_concepts
|
|
207
|
+
):
|
|
208
|
+
allowed_outputs = [
|
|
209
|
+
x
|
|
210
|
+
for x in root.output_concepts
|
|
211
|
+
if not (
|
|
212
|
+
x.address in where_injected
|
|
213
|
+
and x.address not in (root.required_outputs or set())
|
|
214
|
+
)
|
|
215
|
+
]
|
|
216
|
+
|
|
217
|
+
logger.info(
|
|
218
|
+
f"Adjusting group node outputs to remove injected concepts {where_injected}: remaining {allowed_outputs}"
|
|
219
|
+
)
|
|
220
|
+
root.set_output_concepts(allowed_outputs)
|
|
202
221
|
return root
|
|
203
222
|
return GroupNode(
|
|
204
223
|
output_concepts=targets,
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/window_node.py
RENAMED
|
@@ -27,7 +27,7 @@ WINDOW_TYPES = (BuildWindowItem,)
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def resolve_window_parent_concepts(
|
|
30
|
-
concept: BuildConcept, environment: BuildEnvironment
|
|
30
|
+
concept: BuildConcept, environment: BuildEnvironment, depth: int
|
|
31
31
|
) -> tuple[BuildConcept, List[BuildConcept]]:
|
|
32
32
|
if not isinstance(concept.lineage, WINDOW_TYPES):
|
|
33
33
|
raise ValueError
|
|
@@ -39,7 +39,9 @@ def resolve_window_parent_concepts(
|
|
|
39
39
|
base += item.concept_arguments
|
|
40
40
|
if concept.grain:
|
|
41
41
|
for gitem in concept.grain.components:
|
|
42
|
-
logger.info(
|
|
42
|
+
logger.info(
|
|
43
|
+
f"{padding(depth)}{LOGGER_PREFIX} appending grain item {gitem} to base"
|
|
44
|
+
)
|
|
43
45
|
base.append(environment.concepts[gitem])
|
|
44
46
|
return concept.lineage.content, unique(base, "address")
|
|
45
47
|
|
|
@@ -54,7 +56,7 @@ def gen_window_node(
|
|
|
54
56
|
history: History,
|
|
55
57
|
conditions: BuildWhereClause | None = None,
|
|
56
58
|
) -> StrategyNode | None:
|
|
57
|
-
base, parent_concepts = resolve_window_parent_concepts(concept, environment)
|
|
59
|
+
base, parent_concepts = resolve_window_parent_concepts(concept, environment, depth)
|
|
58
60
|
logger.info(
|
|
59
61
|
f"{padding(depth)}{LOGGER_PREFIX} generating window node for {concept} with parents {[x.address for x in parent_concepts]} and optional {local_optional}"
|
|
60
62
|
)
|
|
@@ -62,7 +64,7 @@ def gen_window_node(
|
|
|
62
64
|
x
|
|
63
65
|
for x in local_optional
|
|
64
66
|
if isinstance(x.lineage, WINDOW_TYPES)
|
|
65
|
-
and resolve_window_parent_concepts(x, environment)[1] == parent_concepts
|
|
67
|
+
and resolve_window_parent_concepts(x, environment, depth)[1] == parent_concepts
|
|
66
68
|
]
|
|
67
69
|
|
|
68
70
|
targets = [base]
|
|
@@ -79,7 +81,7 @@ def gen_window_node(
|
|
|
79
81
|
if equivalent_optional:
|
|
80
82
|
for x in equivalent_optional:
|
|
81
83
|
assert isinstance(x.lineage, WINDOW_TYPES)
|
|
82
|
-
base, parents = resolve_window_parent_concepts(x, environment)
|
|
84
|
+
base, parents = resolve_window_parent_concepts(x, environment, depth)
|
|
83
85
|
logger.info(
|
|
84
86
|
f"{padding(depth)}{LOGGER_PREFIX} found equivalent optional {x} with parents {parents}"
|
|
85
87
|
)
|
|
@@ -49,6 +49,7 @@ class GroupNode(StrategyNode):
|
|
|
49
49
|
existence_concepts: List[BuildConcept] | None = None,
|
|
50
50
|
hidden_concepts: set[str] | None = None,
|
|
51
51
|
ordering: BuildOrderBy | None = None,
|
|
52
|
+
required_outputs: List[BuildConcept] | None = None,
|
|
52
53
|
):
|
|
53
54
|
super().__init__(
|
|
54
55
|
input_concepts=input_concepts,
|
|
@@ -66,6 +67,9 @@ class GroupNode(StrategyNode):
|
|
|
66
67
|
hidden_concepts=hidden_concepts,
|
|
67
68
|
ordering=ordering,
|
|
68
69
|
)
|
|
70
|
+
# the set of concepts required to preserve grain
|
|
71
|
+
# set by group by node generation with aggregates
|
|
72
|
+
self.required_outputs = required_outputs
|
|
69
73
|
|
|
70
74
|
@classmethod
|
|
71
75
|
def check_if_required(
|
|
@@ -184,4 +188,7 @@ class GroupNode(StrategyNode):
|
|
|
184
188
|
existence_concepts=list(self.existence_concepts),
|
|
185
189
|
hidden_concepts=set(self.hidden_concepts),
|
|
186
190
|
ordering=self.ordering,
|
|
191
|
+
required_outputs=(
|
|
192
|
+
list(self.required_outputs) if self.required_outputs else None
|
|
193
|
+
),
|
|
187
194
|
)
|
|
@@ -8,7 +8,14 @@ from typing import Any
|
|
|
8
8
|
from jinja2 import Template
|
|
9
9
|
|
|
10
10
|
from trilogy.constants import DEFAULT_NAMESPACE, VIRTUAL_CONCEPT_PREFIX, MagicConstants
|
|
11
|
-
from trilogy.core.enums import
|
|
11
|
+
from trilogy.core.enums import (
|
|
12
|
+
ConceptSource,
|
|
13
|
+
DatePart,
|
|
14
|
+
FunctionType,
|
|
15
|
+
Modifier,
|
|
16
|
+
Purpose,
|
|
17
|
+
ValidationScope,
|
|
18
|
+
)
|
|
12
19
|
from trilogy.core.models.author import (
|
|
13
20
|
AggregateWrapper,
|
|
14
21
|
AlignClause,
|
|
@@ -66,6 +73,7 @@ from trilogy.core.statements.author import (
|
|
|
66
73
|
SelectItem,
|
|
67
74
|
SelectStatement,
|
|
68
75
|
TypeDeclaration,
|
|
76
|
+
ValidateStatement,
|
|
69
77
|
)
|
|
70
78
|
|
|
71
79
|
QUERY_TEMPLATE = Template(
|
|
@@ -445,6 +453,13 @@ class Renderer:
|
|
|
445
453
|
final = "".join(prefixes)
|
|
446
454
|
return f"{final}{self.to_string(arg.content)}"
|
|
447
455
|
|
|
456
|
+
@to_string.register
|
|
457
|
+
def _(self, arg: ValidateStatement):
|
|
458
|
+
targets = ",".join(arg.targets) if arg.targets else "*"
|
|
459
|
+
if arg.scope.value == ValidationScope.ALL:
|
|
460
|
+
return "validate all;"
|
|
461
|
+
return f"validate {arg.scope.value} {targets};"
|
|
462
|
+
|
|
448
463
|
@to_string.register
|
|
449
464
|
def _(self, arg: SelectStatement):
|
|
450
465
|
with self.indented():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/hide_unused_concept.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/optimizations/predicate_pushdown.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/discovery_node_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/common.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/constant_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/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.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.106 → pytrilogy-0.0.3.107}/trilogy/core/processing/node_generators/unnest_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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|