pytrilogy 0.0.3.98__tar.gz → 0.0.3.99__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.98/pytrilogy.egg-info → pytrilogy-0.0.3.99}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/node_merge_node.py +38 -11
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/executor.py +9 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/parse_engine.py +3 -1
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/README.md +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/setup.cfg +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/setup.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_execute_models.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_failure.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_parsing_failures.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_query_render.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_typing.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_user_functions.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/authoring/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/author.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/environment.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/models/execute.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/discovery_loop.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/discovery_node_factory.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/discovery_utility.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/discovery_validation.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/constant_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/recursive_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/recursive_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/utility.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/validation/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/validation/common.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/validation/concept.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/validation/datasource.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/validation/environment.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/validation/fix.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/dataframe.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/duckdb.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/metadata.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/render.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/__init__.py +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/date.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/display.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/geography.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/metric.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/money.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/net.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/ranking.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/std/report.preql +0 -0
- {pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/utility.py +0 -0
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/node_merge_node.py
RENAMED
|
@@ -5,7 +5,7 @@ import networkx as nx
|
|
|
5
5
|
from networkx.algorithms import approximation as ax
|
|
6
6
|
|
|
7
7
|
from trilogy.constants import logger
|
|
8
|
-
from trilogy.core.enums import Derivation
|
|
8
|
+
from trilogy.core.enums import Derivation, FunctionType
|
|
9
9
|
from trilogy.core.exceptions import AmbiguousRelationshipResolutionException
|
|
10
10
|
from trilogy.core.graph_models import (
|
|
11
11
|
ReferenceGraph,
|
|
@@ -15,6 +15,7 @@ from trilogy.core.graph_models import (
|
|
|
15
15
|
from trilogy.core.models.build import (
|
|
16
16
|
BuildConcept,
|
|
17
17
|
BuildConditional,
|
|
18
|
+
BuildFunction,
|
|
18
19
|
BuildGrain,
|
|
19
20
|
BuildWhereClause,
|
|
20
21
|
)
|
|
@@ -145,6 +146,7 @@ def reinject_common_join_keys_v2(
|
|
|
145
146
|
|
|
146
147
|
ds_graph = prune_and_merge(final, is_ds_node)
|
|
147
148
|
injected = False
|
|
149
|
+
|
|
148
150
|
for datasource in ds_graph.nodes:
|
|
149
151
|
node1 = G.datasources[datasource]
|
|
150
152
|
neighbors = nx.all_neighbors(ds_graph, datasource)
|
|
@@ -159,7 +161,7 @@ def reinject_common_join_keys_v2(
|
|
|
159
161
|
reduced = BuildGrain.from_concepts(concrete_concepts).components
|
|
160
162
|
existing_addresses = set()
|
|
161
163
|
for concrete in concrete_concepts:
|
|
162
|
-
logger.
|
|
164
|
+
logger.debug(
|
|
163
165
|
f"looking at column {concrete.address} with pseudonyms {concrete.pseudonyms}"
|
|
164
166
|
)
|
|
165
167
|
cnode = concept_to_node(concrete.with_default_grain())
|
|
@@ -171,14 +173,16 @@ def reinject_common_join_keys_v2(
|
|
|
171
173
|
continue
|
|
172
174
|
if concrete.address not in reduced:
|
|
173
175
|
continue
|
|
176
|
+
if concrete.address in existing_addresses:
|
|
177
|
+
continue
|
|
174
178
|
# skip anything that is already in the graph pseudonyms
|
|
175
179
|
if any(x in concrete.pseudonyms for x in existing_addresses):
|
|
176
180
|
continue
|
|
177
181
|
cnode = concept_to_node(concrete.with_default_grain())
|
|
178
182
|
final.add_edge(datasource, cnode)
|
|
179
183
|
final.add_edge(neighbor, cnode)
|
|
180
|
-
logger.
|
|
181
|
-
f"{LOGGER_PREFIX} reinjecting common join key {cnode} between {datasource} and {neighbor}"
|
|
184
|
+
logger.debug(
|
|
185
|
+
f"{LOGGER_PREFIX} reinjecting common join key {cnode} to list {nodelist} between {datasource} and {neighbor}, existing {existing_addresses}"
|
|
182
186
|
)
|
|
183
187
|
injected = True
|
|
184
188
|
return injected
|
|
@@ -193,6 +197,26 @@ def determine_induced_minimal_nodes(
|
|
|
193
197
|
synonyms: set[str] = set(),
|
|
194
198
|
) -> nx.DiGraph | None:
|
|
195
199
|
H: nx.Graph = nx.to_undirected(G).copy()
|
|
200
|
+
|
|
201
|
+
# Add weights to edges based on target node's derivation type
|
|
202
|
+
for edge in G.edges():
|
|
203
|
+
_, target = edge
|
|
204
|
+
target_lookup = G.concepts.get(target)
|
|
205
|
+
|
|
206
|
+
weight = 1 # default weight
|
|
207
|
+
# If either node is BASIC, set higher weight
|
|
208
|
+
if target_lookup and target_lookup.derivation == Derivation.BASIC:
|
|
209
|
+
if (
|
|
210
|
+
isinstance(target_lookup.lineage, BuildFunction)
|
|
211
|
+
and target_lookup.lineage.operator == FunctionType.ATTR_ACCESS
|
|
212
|
+
):
|
|
213
|
+
weight = 1
|
|
214
|
+
else:
|
|
215
|
+
# raise SyntaxError(target_lookup.lineage.operator)
|
|
216
|
+
weight = 50
|
|
217
|
+
|
|
218
|
+
H.edges[edge]["weight"] = weight
|
|
219
|
+
|
|
196
220
|
nodes_to_remove = []
|
|
197
221
|
for node, lookup in G.concepts.items():
|
|
198
222
|
# inclusion of aggregates can create ambiguous node relation chains
|
|
@@ -217,27 +241,29 @@ def determine_induced_minimal_nodes(
|
|
|
217
241
|
|
|
218
242
|
zero_out = list(x for x in H.nodes if G.out_degree(x) == 0 and x not in nodelist)
|
|
219
243
|
while zero_out:
|
|
220
|
-
|
|
244
|
+
logger.debug(f"Removing zero out nodes {zero_out} from graph")
|
|
221
245
|
H.remove_nodes_from(zero_out)
|
|
222
246
|
zero_out = list(
|
|
223
247
|
x for x in H.nodes if G.out_degree(x) == 0 and x not in nodelist
|
|
224
248
|
)
|
|
225
249
|
try:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
250
|
+
# Use weight attribute for Dijkstra pathfinding
|
|
251
|
+
paths = nx.multi_source_dijkstra_path(H, nodelist, weight="weight")
|
|
252
|
+
# logger.debug(f"Paths found for {nodelist} {paths}")
|
|
253
|
+
except nx.exception.NodeNotFound as e:
|
|
254
|
+
logger.debug(f"Unable to find paths for {nodelist}- {str(e)}")
|
|
230
255
|
return None
|
|
231
256
|
path_removals = list(x for x in H.nodes if x not in paths)
|
|
232
257
|
if path_removals:
|
|
233
258
|
# logger.debug(f"Removing paths {path_removals} from graph")
|
|
234
259
|
H.remove_nodes_from(path_removals)
|
|
235
260
|
# logger.debug(f"Graph after path removal {H.nodes}")
|
|
236
|
-
sG: nx.Graph = ax.steinertree.steiner_tree(H, nodelist).copy()
|
|
261
|
+
sG: nx.Graph = ax.steinertree.steiner_tree(H, nodelist, weight="weight").copy()
|
|
237
262
|
if not sG.nodes:
|
|
238
263
|
logger.debug(f"No Steiner tree found for nodes {nodelist}")
|
|
239
264
|
return None
|
|
240
|
-
|
|
265
|
+
|
|
266
|
+
logger.debug(f"Steiner tree found for nodes {nodelist} {sG.nodes}")
|
|
241
267
|
final: nx.DiGraph = nx.subgraph(G, sG.nodes).copy()
|
|
242
268
|
|
|
243
269
|
for edge in G.edges:
|
|
@@ -273,6 +299,7 @@ def determine_induced_minimal_nodes(
|
|
|
273
299
|
logger.debug(
|
|
274
300
|
f"Skipping graph for initial list {nodelist} as missing nodes {missing} from final graph {final.nodes}"
|
|
275
301
|
)
|
|
302
|
+
|
|
276
303
|
return None
|
|
277
304
|
logger.debug(f"Found final graph {final.nodes}")
|
|
278
305
|
return final
|
|
@@ -204,6 +204,15 @@ class Executor(object):
|
|
|
204
204
|
output.append(compiled_sql)
|
|
205
205
|
return output
|
|
206
206
|
|
|
207
|
+
@generate_sql.register
|
|
208
|
+
def _(self, command: ProcessedShowStatement) -> List[str]:
|
|
209
|
+
output = []
|
|
210
|
+
for statement in command.output_values:
|
|
211
|
+
if isinstance(statement, (ProcessedQuery, ProcessedQueryPersist)):
|
|
212
|
+
compiled_sql = self.generator.compile_statement(statement)
|
|
213
|
+
output.append(compiled_sql)
|
|
214
|
+
return output
|
|
215
|
+
|
|
207
216
|
@generate_sql.register # type: ignore
|
|
208
217
|
def _(self, command: MultiSelectStatement) -> List[str]:
|
|
209
218
|
output = []
|
|
@@ -2295,7 +2295,9 @@ def parse_text(
|
|
|
2295
2295
|
raise _create_syntax_error(210, pos, text)
|
|
2296
2296
|
|
|
2297
2297
|
# Handle FROM token error
|
|
2298
|
-
parsed_tokens =
|
|
2298
|
+
parsed_tokens = (
|
|
2299
|
+
[x.value for x in e.token_history if x] if e.token_history else []
|
|
2300
|
+
)
|
|
2299
2301
|
if parsed_tokens == ["FROM"]:
|
|
2300
2302
|
raise _create_syntax_error(101, pos, text)
|
|
2301
2303
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/constant_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/recursive_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/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.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.98 → pytrilogy-0.0.3.99}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|