pytrilogy 0.0.3.83__py3-none-any.whl → 0.0.3.85__py3-none-any.whl
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.83.dist-info → pytrilogy-0.0.3.85.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.3.83.dist-info → pytrilogy-0.0.3.85.dist-info}/RECORD +11 -11
- trilogy/__init__.py +1 -1
- trilogy/core/processing/node_generators/node_merge_node.py +4 -4
- trilogy/core/processing/utility.py +23 -13
- trilogy/std/geography.preql +3 -2
- trilogy/std/net.preql +12 -7
- {pytrilogy-0.0.3.83.dist-info → pytrilogy-0.0.3.85.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.3.83.dist-info → pytrilogy-0.0.3.85.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.3.83.dist-info → pytrilogy-0.0.3.85.dist-info}/licenses/LICENSE.md +0 -0
- {pytrilogy-0.0.3.83.dist-info → pytrilogy-0.0.3.85.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
pytrilogy-0.0.3.
|
|
2
|
-
trilogy/__init__.py,sha256=
|
|
1
|
+
pytrilogy-0.0.3.85.dist-info/licenses/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
2
|
+
trilogy/__init__.py,sha256=QKLkKDYevuT744TmiXXQu3mkG_tT9lB3iztr5_Mq7tU,303
|
|
3
3
|
trilogy/compiler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
trilogy/constants.py,sha256=eKb_EJvSqjN9tGbdVEViwdtwwh8fZ3-jpOEDqL71y70,1691
|
|
5
5
|
trilogy/engine.py,sha256=OK2RuqCIUId6yZ5hfF8J1nxGP0AJqHRZiafcowmW0xc,1728
|
|
@@ -41,7 +41,7 @@ trilogy/core/processing/discovery_node_factory.py,sha256=5QVYUsci_h6iYWhS0GCoDow
|
|
|
41
41
|
trilogy/core/processing/discovery_utility.py,sha256=eY4n7_r6_R-cx_Sm8FiouMXh78v2iO2SGhi0aI5jvDg,4549
|
|
42
42
|
trilogy/core/processing/discovery_validation.py,sha256=eZ4HfHMpqZLI8MGG2jez8arS8THs6ceuVrQFIY6gXrU,5364
|
|
43
43
|
trilogy/core/processing/graph_utils.py,sha256=8QUVrkE9j-9C1AyrCb1nQEh8daCe0u1HuXl-Te85lag,1205
|
|
44
|
-
trilogy/core/processing/utility.py,sha256=
|
|
44
|
+
trilogy/core/processing/utility.py,sha256=PGQKZgX58kI3gG4nprY8HRGayc2D8fF5RmbvBhQj8ok,23319
|
|
45
45
|
trilogy/core/processing/node_generators/__init__.py,sha256=iVJ-crowPxYeut-hFjyEjfibKIDq7PfB4LEuDAUCjGY,943
|
|
46
46
|
trilogy/core/processing/node_generators/basic_node.py,sha256=TLZCv4WS196a-0g5xgKuJGthnGP8Ugm46iz85_3NIY4,5626
|
|
47
47
|
trilogy/core/processing/node_generators/common.py,sha256=PdysdroW9DUADP7f5Wv_GKPUyCTROZV1g3L45fawxi8,9443
|
|
@@ -50,7 +50,7 @@ trilogy/core/processing/node_generators/filter_node.py,sha256=oRRq2-T3ufgn4D23uQ
|
|
|
50
50
|
trilogy/core/processing/node_generators/group_node.py,sha256=1QJhRxsTklJ5xq8wHlAURZaN9gL9FPpeCa1OJ7IwXnY,6769
|
|
51
51
|
trilogy/core/processing/node_generators/group_to_node.py,sha256=jKcNCDOY6fNblrdZwaRU0sbUSr9H0moQbAxrGgX6iGA,3832
|
|
52
52
|
trilogy/core/processing/node_generators/multiselect_node.py,sha256=GWV5yLmKTe1yyPhN60RG1Rnrn4ktfn9lYYXi_FVU4UI,7061
|
|
53
|
-
trilogy/core/processing/node_generators/node_merge_node.py,sha256=
|
|
53
|
+
trilogy/core/processing/node_generators/node_merge_node.py,sha256=sUKS9bSTeYNCyF9jibrkac1_QkmxD-k4x35nQK1b9cM,18312
|
|
54
54
|
trilogy/core/processing/node_generators/recursive_node.py,sha256=l5zdh0dURKwmAy8kK4OpMtZfyUEQRk6N-PwSWIyBpSM,2468
|
|
55
55
|
trilogy/core/processing/node_generators/rowset_node.py,sha256=5L5u6xz1In8EaHQdcYgR2si-tz9WB9YLXURo4AkUT9A,6630
|
|
56
56
|
trilogy/core/processing/node_generators/select_merge_node.py,sha256=Cv2GwNiYSmwewjuK8T3JB3pbgrLZFPsB75DCP153BMA,22818
|
|
@@ -106,13 +106,13 @@ trilogy/scripts/trilogy.py,sha256=1L0XrH4mVHRt1C9T1HnaDv2_kYEfbWTb5_-cBBke79w,37
|
|
|
106
106
|
trilogy/std/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
107
|
trilogy/std/date.preql,sha256=HWZm4t4HWyxr5geWRsY05RnHBVDMci8z8YA2cu0-OOw,188
|
|
108
108
|
trilogy/std/display.preql,sha256=nm7lox87Xf6lBvXCVCS6x2HskguMKzndEBucJ5pktzk,175
|
|
109
|
-
trilogy/std/geography.preql,sha256=
|
|
109
|
+
trilogy/std/geography.preql,sha256=1A9Sq5PPMBnEPPf7f-rPVYxJfsnWpQ8oV_k4Fm3H2dU,675
|
|
110
110
|
trilogy/std/money.preql,sha256=XWwvAV3WxBsHX9zfptoYRnBigcfYwrYtBHXTME0xJuQ,2082
|
|
111
|
-
trilogy/std/net.preql,sha256=
|
|
111
|
+
trilogy/std/net.preql,sha256=WZCuvH87_rZntZiuGJMmBDMVKkdhTtxeHOkrXNwJ1EE,416
|
|
112
112
|
trilogy/std/ranking.preql,sha256=LDoZrYyz4g3xsII9XwXfmstZD-_92i1Eox1UqkBIfi8,83
|
|
113
113
|
trilogy/std/report.preql,sha256=LbV-XlHdfw0jgnQ8pV7acG95xrd1-p65fVpiIc-S7W4,202
|
|
114
|
-
pytrilogy-0.0.3.
|
|
115
|
-
pytrilogy-0.0.3.
|
|
116
|
-
pytrilogy-0.0.3.
|
|
117
|
-
pytrilogy-0.0.3.
|
|
118
|
-
pytrilogy-0.0.3.
|
|
114
|
+
pytrilogy-0.0.3.85.dist-info/METADATA,sha256=FTQH7poVd-VpFg3tbI6vjCVJON0KYSxXUIdcS5CDHAc,9589
|
|
115
|
+
pytrilogy-0.0.3.85.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
116
|
+
pytrilogy-0.0.3.85.dist-info/entry_points.txt,sha256=ewBPU2vLnVexZVnB-NrVj-p3E-4vukg83Zk8A55Wp2w,56
|
|
117
|
+
pytrilogy-0.0.3.85.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
118
|
+
pytrilogy-0.0.3.85.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
|
@@ -104,16 +104,16 @@ def determine_induced_minimal_nodes(
|
|
|
104
104
|
if filter_downstream and lookup.derivation not in (Derivation.ROOT,):
|
|
105
105
|
nodes_to_remove.append(node)
|
|
106
106
|
if nodes_to_remove:
|
|
107
|
-
logger.debug(f"Removing nodes {nodes_to_remove} from graph")
|
|
107
|
+
# logger.debug(f"Removing nodes {nodes_to_remove} from graph")
|
|
108
108
|
H.remove_nodes_from(nodes_to_remove)
|
|
109
109
|
isolates = list(nx.isolates(H))
|
|
110
110
|
if isolates:
|
|
111
|
-
logger.debug(f"Removing isolates {isolates} from graph")
|
|
111
|
+
# logger.debug(f"Removing isolates {isolates} from graph")
|
|
112
112
|
H.remove_nodes_from(isolates)
|
|
113
113
|
|
|
114
114
|
zero_out = list(x for x in H.nodes if G.out_degree(x) == 0 and x not in nodelist)
|
|
115
115
|
while zero_out:
|
|
116
|
-
logger.debug(f"Removing zero out nodes {zero_out} from graph")
|
|
116
|
+
# logger.debug(f"Removing zero out nodes {zero_out} from graph")
|
|
117
117
|
H.remove_nodes_from(zero_out)
|
|
118
118
|
zero_out = list(
|
|
119
119
|
x for x in H.nodes if G.out_degree(x) == 0 and x not in nodelist
|
|
@@ -128,7 +128,7 @@ def determine_induced_minimal_nodes(
|
|
|
128
128
|
if path_removals:
|
|
129
129
|
logger.debug(f"Removing paths {path_removals} from graph")
|
|
130
130
|
H.remove_nodes_from(path_removals)
|
|
131
|
-
logger.debug(f"Graph after path removal {H.nodes}")
|
|
131
|
+
# logger.debug(f"Graph after path removal {H.nodes}")
|
|
132
132
|
sG: nx.Graph = ax.steinertree.steiner_tree(H, nodelist).copy()
|
|
133
133
|
if not sG.nodes:
|
|
134
134
|
logger.debug(f"No Steiner tree found for nodes {nodelist}")
|
|
@@ -161,6 +161,9 @@ def resolve_join_order_v2(
|
|
|
161
161
|
left_is_partial = any(
|
|
162
162
|
key in partials.get(left_candidate, []) for key in common
|
|
163
163
|
)
|
|
164
|
+
left_is_nullable = any(
|
|
165
|
+
key in nullables.get(left_candidate, []) for key in common
|
|
166
|
+
)
|
|
164
167
|
right_is_partial = any(key in partials.get(right, []) for key in common)
|
|
165
168
|
# we don't care if left is nullable for join type (just keys), but if we did
|
|
166
169
|
# left_is_nullable = any(
|
|
@@ -169,21 +172,29 @@ def resolve_join_order_v2(
|
|
|
169
172
|
right_is_nullable = any(
|
|
170
173
|
key in nullables.get(right, []) for key in common
|
|
171
174
|
)
|
|
172
|
-
if
|
|
175
|
+
if left_is_nullable and right_is_nullable:
|
|
176
|
+
join_type = JoinType.FULL
|
|
177
|
+
elif left_is_partial and right_is_partial:
|
|
178
|
+
join_type = JoinType.FULL
|
|
179
|
+
elif left_is_partial:
|
|
173
180
|
join_type = JoinType.FULL
|
|
174
|
-
elif
|
|
181
|
+
elif right_is_nullable:
|
|
182
|
+
join_type = JoinType.RIGHT_OUTER
|
|
183
|
+
elif right_is_partial or left_is_nullable:
|
|
175
184
|
join_type = JoinType.LEFT_OUTER
|
|
176
185
|
# we can't inner join if the left was an outer join
|
|
177
186
|
else:
|
|
178
187
|
join_type = JoinType.INNER
|
|
188
|
+
|
|
179
189
|
join_types.add(join_type)
|
|
180
190
|
joinkeys[left_candidate] = common
|
|
181
|
-
|
|
182
191
|
final_join_type = JoinType.INNER
|
|
183
|
-
if any([x == JoinType.
|
|
184
|
-
final_join_type = JoinType.LEFT_OUTER
|
|
185
|
-
elif any([x == JoinType.FULL for x in join_types]):
|
|
192
|
+
if any([x == JoinType.FULL for x in join_types]):
|
|
186
193
|
final_join_type = JoinType.FULL
|
|
194
|
+
elif any([x == JoinType.LEFT_OUTER for x in join_types]):
|
|
195
|
+
final_join_type = JoinType.LEFT_OUTER
|
|
196
|
+
elif any([x == JoinType.RIGHT_OUTER for x in join_types]):
|
|
197
|
+
final_join_type = JoinType.RIGHT_OUTER
|
|
187
198
|
output.append(
|
|
188
199
|
JoinOrderOutput(
|
|
189
200
|
# left=left_candidate,
|
|
@@ -608,13 +619,12 @@ def find_nullable_concepts(
|
|
|
608
619
|
local_nullable = [
|
|
609
620
|
x for x in datasources if k in [v.address for v in x.nullable_concepts]
|
|
610
621
|
]
|
|
611
|
-
|
|
612
|
-
[
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
):
|
|
622
|
+
nullable_matches = [
|
|
623
|
+
k in [v.address for v in x.nullable_concepts]
|
|
624
|
+
for x in datasources
|
|
625
|
+
if k in [z.address for z in x.output_concepts]
|
|
626
|
+
]
|
|
627
|
+
if all(nullable_matches) and len(nullable_matches) > 0:
|
|
618
628
|
final_nullable.add(k)
|
|
619
629
|
all_ds = set([ds for ds in local_nullable]).union(nullable_datasources)
|
|
620
630
|
if nullable_datasources:
|
trilogy/std/geography.preql
CHANGED
|
@@ -9,10 +9,11 @@ type us_zip_code string; # US ZIP code
|
|
|
9
9
|
## generic types
|
|
10
10
|
type latitude float; # Latitude in degrees
|
|
11
11
|
type longitude float; # Longitude in degrees
|
|
12
|
-
type lat_long string; # Latitude and longitude in degrees
|
|
12
|
+
type lat_long string; # Latitude and longitude in degrees, as a coordinate pair
|
|
13
13
|
|
|
14
14
|
type city string; # City name
|
|
15
|
-
type country string; # Country
|
|
15
|
+
type country string; # Full Country Name
|
|
16
|
+
type country_code string; # ISO-3166 Country code - ex US, CA, GB
|
|
16
17
|
type timezone string; # Timezone name
|
|
17
18
|
type region string; # Region name
|
|
18
19
|
|
trilogy/std/net.preql
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
## network types
|
|
3
|
+
type url string; # URL string
|
|
4
|
+
type url_image string; # URL of an image
|
|
5
|
+
type domain string; # Domain name
|
|
6
|
+
type ip_net_mask string; # IP network mask
|
|
7
|
+
type ipv6_address string; # IPv6 address
|
|
8
|
+
type ipv4_address string; # IPv4 address
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
type suffix string;
|
|
9
|
-
type url_image string;
|
|
10
|
+
## communication types
|
|
11
|
+
type email_address string; # Email address, including @
|
|
12
|
+
|
|
13
|
+
## shared types
|
|
14
|
+
type suffix string; # A file suffix or extension, like .txt, .jpg, etc.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|