pytrilogy 0.0.2.44__tar.gz → 0.0.2.45__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.44/pytrilogy.egg-info → pytrilogy-0.0.2.45}/PKG-INFO +1 -1
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/models.py +20 -10
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/LICENSE.md +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/README.md +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/pyproject.toml +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/setup.cfg +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/setup.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_models.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_select.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_show.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/compiler.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/optimizations/inline_constant.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/executor.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/parse_engine.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/utility.py +0 -0
|
@@ -2307,9 +2307,11 @@ class UnnestJoin(BaseModel):
|
|
|
2307
2307
|
rendering_required: bool = True
|
|
2308
2308
|
|
|
2309
2309
|
def __hash__(self):
|
|
2310
|
-
return (
|
|
2311
|
-
|
|
2312
|
-
|
|
2310
|
+
return self.safe_identifier.__hash__()
|
|
2311
|
+
|
|
2312
|
+
@property
|
|
2313
|
+
def safe_identifier(self) -> str:
|
|
2314
|
+
return self.alias + "".join([str(s.address) for s in self.concepts])
|
|
2313
2315
|
|
|
2314
2316
|
|
|
2315
2317
|
class InstantiatedUnnestJoin(BaseModel):
|
|
@@ -2544,7 +2546,7 @@ class QueryDatasource(BaseModel):
|
|
|
2544
2546
|
return True
|
|
2545
2547
|
return False
|
|
2546
2548
|
|
|
2547
|
-
def __add__(self, other):
|
|
2549
|
+
def __add__(self, other) -> "QueryDatasource":
|
|
2548
2550
|
# these are syntax errors to avoid being caught by current
|
|
2549
2551
|
if not isinstance(other, QueryDatasource):
|
|
2550
2552
|
raise SyntaxError("Can only merge two query datasources")
|
|
@@ -2570,7 +2572,7 @@ class QueryDatasource(BaseModel):
|
|
|
2570
2572
|
f" {other.name} with {[c.address for c in other.output_concepts]} concepts"
|
|
2571
2573
|
)
|
|
2572
2574
|
|
|
2573
|
-
merged_datasources = {}
|
|
2575
|
+
merged_datasources: dict[str, Union[Datasource, "QueryDatasource"]] = {}
|
|
2574
2576
|
|
|
2575
2577
|
for ds in [*self.datasources, *other.datasources]:
|
|
2576
2578
|
if ds.safe_identifier in merged_datasources:
|
|
@@ -2580,20 +2582,29 @@ class QueryDatasource(BaseModel):
|
|
|
2580
2582
|
else:
|
|
2581
2583
|
merged_datasources[ds.safe_identifier] = ds
|
|
2582
2584
|
|
|
2583
|
-
final_source_map
|
|
2585
|
+
final_source_map: defaultdict[
|
|
2586
|
+
str, Set[Union[Datasource, "QueryDatasource", "UnnestJoin"]]
|
|
2587
|
+
] = defaultdict(set)
|
|
2588
|
+
|
|
2589
|
+
# add our sources
|
|
2584
2590
|
for key in self.source_map:
|
|
2585
2591
|
final_source_map[key] = self.source_map[key].union(
|
|
2586
2592
|
other.source_map.get(key, set())
|
|
2587
2593
|
)
|
|
2594
|
+
# add their sources
|
|
2588
2595
|
for key in other.source_map:
|
|
2589
2596
|
if key not in final_source_map:
|
|
2590
2597
|
final_source_map[key] = other.source_map[key]
|
|
2598
|
+
|
|
2599
|
+
# if a ds was merged (to combine columns), we need to update the source map
|
|
2600
|
+
# to use the merged item
|
|
2591
2601
|
for k, v in final_source_map.items():
|
|
2592
2602
|
final_source_map[k] = set(
|
|
2593
|
-
merged_datasources
|
|
2603
|
+
merged_datasources.get(x.safe_identifier, x) for x in list(v)
|
|
2594
2604
|
)
|
|
2595
2605
|
self_hidden = self.hidden_concepts or []
|
|
2596
2606
|
other_hidden = other.hidden_concepts or []
|
|
2607
|
+
# hidden is the minimum overlapping set
|
|
2597
2608
|
hidden = [x for x in self_hidden if x.address in other_hidden]
|
|
2598
2609
|
qds = QueryDatasource(
|
|
2599
2610
|
input_concepts=unique(
|
|
@@ -2606,11 +2617,10 @@ class QueryDatasource(BaseModel):
|
|
|
2606
2617
|
datasources=list(merged_datasources.values()),
|
|
2607
2618
|
grain=self.grain,
|
|
2608
2619
|
joins=unique(self.joins + other.joins, "unique_id"),
|
|
2609
|
-
# joins = self.joins,
|
|
2610
2620
|
condition=(
|
|
2611
2621
|
self.condition + other.condition
|
|
2612
|
-
if
|
|
2613
|
-
else
|
|
2622
|
+
if self.condition and other.condition
|
|
2623
|
+
else self.condition or other.condition
|
|
2614
2624
|
),
|
|
2615
2625
|
source_type=self.source_type,
|
|
2616
2626
|
partial_concepts=unique(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/node_merge_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/rowset_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.2.44 → pytrilogy-0.0.2.45}/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
|