pytrilogy 0.0.3.119__py3-none-any.whl → 0.0.3.120__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.119.dist-info → pytrilogy-0.0.3.120.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.3.119.dist-info → pytrilogy-0.0.3.120.dist-info}/RECORD +11 -11
- trilogy/__init__.py +1 -1
- trilogy/ai/conversation.py +3 -4
- trilogy/core/models/environment.py +3 -2
- trilogy/core/processing/discovery_utility.py +4 -4
- trilogy/core/processing/nodes/base_node.py +5 -1
- {pytrilogy-0.0.3.119.dist-info → pytrilogy-0.0.3.120.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.3.119.dist-info → pytrilogy-0.0.3.120.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.3.119.dist-info → pytrilogy-0.0.3.120.dist-info}/licenses/LICENSE.md +0 -0
- {pytrilogy-0.0.3.119.dist-info → pytrilogy-0.0.3.120.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.120.dist-info/licenses/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
2
|
+
trilogy/__init__.py,sha256=BF_I6R5zTDgQVvWrf-0TvooZTV3UV4ex98-KtPY70ak,304
|
|
3
3
|
trilogy/constants.py,sha256=_Tm7YGaAZuxH77X5ve0TajU0dQD7RcGV6ECrTHRL3qQ,2678
|
|
4
4
|
trilogy/engine.py,sha256=v4TpNktM4zZ9OX7jZH2nde4dpX5uAH2U23ELfULTCSg,2280
|
|
5
5
|
trilogy/executor.py,sha256=uKlCnPp4FHkgsa_dDcQJ4y-ObtvKat2KFx05c-z1mZo,17885
|
|
@@ -9,7 +9,7 @@ trilogy/render.py,sha256=qQWwduymauOlB517UtM-VGbVe8Cswa4UJub5aGbSO6c,1512
|
|
|
9
9
|
trilogy/utility.py,sha256=euQccZLKoYBz0LNg5tzLlvv2YHvXh9HArnYp1V3uXsM,763
|
|
10
10
|
trilogy/ai/__init__.py,sha256=H6gpzScruX2xgZNRDMjQ31Wy45irJbdebX1fU_gOwI8,581
|
|
11
11
|
trilogy/ai/constants.py,sha256=Aj-_mFqskcXqIlBjX_A9eqH0V9M8mqX3uJwUhr9puak,5064
|
|
12
|
-
trilogy/ai/conversation.py,sha256=
|
|
12
|
+
trilogy/ai/conversation.py,sha256=yei5iKsVCyo-GRmHtfto2grCjBs_TwAbGChD3w97pqg,3482
|
|
13
13
|
trilogy/ai/enums.py,sha256=vghPPx0W-DioQSgq4T0MGL-8ekFh6O6d52dHo7KsKtg,118
|
|
14
14
|
trilogy/ai/execute.py,sha256=DTARZxm_btCJq4Yd_jPRHJAcbsMLbjEsjR7KKyKBkTI,1335
|
|
15
15
|
trilogy/ai/models.py,sha256=Au4QnTIlv7e-p3XgTJYZqTSndPMGRIbOvCUWlekE81A,683
|
|
@@ -40,7 +40,7 @@ trilogy/core/models/build.py,sha256=zVHD8jo8V8E0aGWtobzXG7hY3VjLChiW4s1QBx9sD5k,
|
|
|
40
40
|
trilogy/core/models/build_environment.py,sha256=mpx7MKGc60fnZLVdeLi2YSREy7eQbQYycCrP4zF-rHU,5258
|
|
41
41
|
trilogy/core/models/core.py,sha256=mv1QOxf-6uGoWpfwuucNAW3W_ZZGQuxtnPWAXhQsxSI,13290
|
|
42
42
|
trilogy/core/models/datasource.py,sha256=wogTevZ-9CyUW2a8gjzqMCieircxi-J5lkI7EOAZnck,9596
|
|
43
|
-
trilogy/core/models/environment.py,sha256
|
|
43
|
+
trilogy/core/models/environment.py,sha256=m2NZ-UqmHQ1qJo6I-cVGG9Z24O6RTDkrvEd1IfVmWls,28889
|
|
44
44
|
trilogy/core/models/execute.py,sha256=3fgEdho2e7S0outq91cCzb9jFwz6L1hTbsTrJwGvIFs,42311
|
|
45
45
|
trilogy/core/optimizations/__init__.py,sha256=yspWc25M5SgAuvXYoSt5J8atyPbDlOfsKjIo5yGD9s4,368
|
|
46
46
|
trilogy/core/optimizations/base_optimization.py,sha256=gzDOKImoFn36k7XBD3ysEYDnbnb6vdVIztUfFQZsGnM,513
|
|
@@ -50,7 +50,7 @@ trilogy/core/optimizations/predicate_pushdown.py,sha256=5ubatgq1IwWQ4L2FDt4--y16
|
|
|
50
50
|
trilogy/core/processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
trilogy/core/processing/concept_strategies_v3.py,sha256=MBQeJGBDW2w3xxwano43-5MVBqfbIU9M3K7RFbnSKNA,23367
|
|
52
52
|
trilogy/core/processing/discovery_node_factory.py,sha256=llnLxZo1NqBRIuuPz0GUohym6LZFhVkPT3xSiORi3k4,15446
|
|
53
|
-
trilogy/core/processing/discovery_utility.py,sha256=
|
|
53
|
+
trilogy/core/processing/discovery_utility.py,sha256=FpCHCvGslHIJkMIOLBmTJRQKfUtwcwiNgzDxcOsJBIc,13532
|
|
54
54
|
trilogy/core/processing/discovery_validation.py,sha256=eZ4HfHMpqZLI8MGG2jez8arS8THs6ceuVrQFIY6gXrU,5364
|
|
55
55
|
trilogy/core/processing/graph_utils.py,sha256=8QUVrkE9j-9C1AyrCb1nQEh8daCe0u1HuXl-Te85lag,1205
|
|
56
56
|
trilogy/core/processing/utility.py,sha256=ESs6pKqVP2c9eMdfB2JNjw7D7YnoezVwbLFx1D6OUYA,26088
|
|
@@ -74,7 +74,7 @@ trilogy/core/processing/node_generators/window_node.py,sha256=wNvmumGO6AIQ7C9bDU
|
|
|
74
74
|
trilogy/core/processing/node_generators/select_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
trilogy/core/processing/node_generators/select_helpers/datasource_injection.py,sha256=m2YQ4OmG0N2O61a7NEq1ZzbTa7JsCC00lxB2ymjcYRI,8224
|
|
76
76
|
trilogy/core/processing/nodes/__init__.py,sha256=zTge1EzwzEydlcMliIFO_TT7h7lS8l37lyZuQDir1h0,5487
|
|
77
|
-
trilogy/core/processing/nodes/base_node.py,sha256=
|
|
77
|
+
trilogy/core/processing/nodes/base_node.py,sha256=xrtijyy38xpTt3hzVdEVaDYhk1JWAuB8yGoDJ6R82Jg,18722
|
|
78
78
|
trilogy/core/processing/nodes/filter_node.py,sha256=5VtRfKbCORx0dV-vQfgy3gOEkmmscL9f31ExvlODwvY,2461
|
|
79
79
|
trilogy/core/processing/nodes/group_node.py,sha256=Ku8El9KQvRiTiHCZDS_jX0DjErSDNv7IIQMcd1Gsk7I,7449
|
|
80
80
|
trilogy/core/processing/nodes/merge_node.py,sha256=4y_itKoipHKjpCIQjK9SHga-Fq-HqyeQLwAoSIFQ1hM,16567
|
|
@@ -133,8 +133,8 @@ trilogy/std/net.preql,sha256=WZCuvH87_rZntZiuGJMmBDMVKkdhTtxeHOkrXNwJ1EE,416
|
|
|
133
133
|
trilogy/std/ranking.preql,sha256=zDdmHcTerlCjaHDdVyjGTgcc2hAhnlDM_q5tiw0MPGE,108
|
|
134
134
|
trilogy/std/report.preql,sha256=LbV-XlHdfw0jgnQ8pV7acG95xrd1-p65fVpiIc-S7W4,202
|
|
135
135
|
trilogy/std/semantic.preql,sha256=k9_k672nUb5MKjSD1DW5jjn_odoYHl0yNeRPOjFabsE,95
|
|
136
|
-
pytrilogy-0.0.3.
|
|
137
|
-
pytrilogy-0.0.3.
|
|
138
|
-
pytrilogy-0.0.3.
|
|
139
|
-
pytrilogy-0.0.3.
|
|
140
|
-
pytrilogy-0.0.3.
|
|
136
|
+
pytrilogy-0.0.3.120.dist-info/METADATA,sha256=stpvqxUMDCp2V1Kb5HP-xcjX_H-IscwNLpfDBbFoXL0,12911
|
|
137
|
+
pytrilogy-0.0.3.120.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
138
|
+
pytrilogy-0.0.3.120.dist-info/entry_points.txt,sha256=ewBPU2vLnVexZVnB-NrVj-p3E-4vukg83Zk8A55Wp2w,56
|
|
139
|
+
pytrilogy-0.0.3.120.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
140
|
+
pytrilogy-0.0.3.120.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
trilogy/ai/conversation.py
CHANGED
|
@@ -61,7 +61,7 @@ class Conversation:
|
|
|
61
61
|
if "```" in content:
|
|
62
62
|
parts = content.split("```")
|
|
63
63
|
if len(parts) >= 3:
|
|
64
|
-
return parts[
|
|
64
|
+
return parts[-2].strip()
|
|
65
65
|
return content
|
|
66
66
|
|
|
67
67
|
def generate_query(
|
|
@@ -78,7 +78,7 @@ class Conversation:
|
|
|
78
78
|
if not response.strip()[-1] == ";":
|
|
79
79
|
response += ";"
|
|
80
80
|
try:
|
|
81
|
-
|
|
81
|
+
_, raw = environment.parse(response)
|
|
82
82
|
process_query(statement=raw[-1], environment=environment)
|
|
83
83
|
return response
|
|
84
84
|
except (
|
|
@@ -90,10 +90,9 @@ class Conversation:
|
|
|
90
90
|
) as e2:
|
|
91
91
|
e = e2
|
|
92
92
|
self.add_message(
|
|
93
|
-
f"
|
|
93
|
+
f"Your extracted response - {response} - could not be parsed due to the error: {str(e)}. Please generate a new query with the issues fixed. Use the same response format.",
|
|
94
94
|
role="user",
|
|
95
95
|
)
|
|
96
|
-
|
|
97
96
|
raise Exception(
|
|
98
97
|
f"Failed to generate a valid query after {attempts} attempts. Last error: {str(e)}. Full conversation: {self.messages}"
|
|
99
98
|
)
|
|
@@ -215,7 +215,7 @@ class Environment(BaseModel):
|
|
|
215
215
|
functions: Dict[str, CustomFunctionFactory] = Field(default_factory=dict)
|
|
216
216
|
data_types: Dict[str, CustomType] = Field(default_factory=dict)
|
|
217
217
|
named_statements: Dict[str, SelectLineage] = Field(default_factory=dict)
|
|
218
|
-
imports:
|
|
218
|
+
imports: defaultdict[str, list[Import]] = Field(
|
|
219
219
|
default_factory=lambda: defaultdict(list) # type: ignore
|
|
220
220
|
)
|
|
221
221
|
namespace: str = DEFAULT_NAMESPACE
|
|
@@ -252,7 +252,7 @@ class Environment(BaseModel):
|
|
|
252
252
|
concepts=self.concepts.duplicate(),
|
|
253
253
|
functions=dict(self.functions),
|
|
254
254
|
data_types=dict(self.data_types),
|
|
255
|
-
imports=
|
|
255
|
+
imports=defaultdict(list, self.imports),
|
|
256
256
|
namespace=self.namespace,
|
|
257
257
|
working_path=self.working_path,
|
|
258
258
|
environment_config=self.config.model_copy(deep=True),
|
|
@@ -262,6 +262,7 @@ class Environment(BaseModel):
|
|
|
262
262
|
alias_origin_lookup={
|
|
263
263
|
k: v.duplicate() for k, v in self.alias_origin_lookup.items()
|
|
264
264
|
},
|
|
265
|
+
env_file_path=self.env_file_path,
|
|
265
266
|
)
|
|
266
267
|
|
|
267
268
|
def _add_path_concepts(self):
|
|
@@ -40,15 +40,15 @@ def calculate_effective_parent_grain(
|
|
|
40
40
|
pairs = join.concept_pairs or []
|
|
41
41
|
for key in pairs:
|
|
42
42
|
left = key.existing_datasource
|
|
43
|
-
logger.
|
|
43
|
+
logger.debug(f"adding left grain {left.grain} for join key {key.left}")
|
|
44
44
|
grain += left.grain
|
|
45
45
|
seen.add(left.name)
|
|
46
46
|
keys = [key.right for key in pairs]
|
|
47
47
|
join_grain = BuildGrain.from_concepts(keys)
|
|
48
48
|
if join_grain == join.right_datasource.grain:
|
|
49
|
-
logger.
|
|
49
|
+
logger.debug(f"irrelevant right join {join}, does not change grain")
|
|
50
50
|
else:
|
|
51
|
-
logger.
|
|
51
|
+
logger.debug(
|
|
52
52
|
f"join changes grain, adding {join.right_datasource.grain} to {grain}"
|
|
53
53
|
)
|
|
54
54
|
grain += join.right_datasource.grain
|
|
@@ -68,7 +68,7 @@ def calculate_effective_parent_grain(
|
|
|
68
68
|
]
|
|
69
69
|
)
|
|
70
70
|
):
|
|
71
|
-
logger.
|
|
71
|
+
logger.debug(f"adding unjoined grain {x.grain} for datasource {x.name}")
|
|
72
72
|
grain += x.grain
|
|
73
73
|
return grain
|
|
74
74
|
else:
|
|
@@ -258,10 +258,14 @@ class StrategyNode:
|
|
|
258
258
|
self.partial_lcl = LooseBuildConceptList(concepts=partials)
|
|
259
259
|
return partials
|
|
260
260
|
|
|
261
|
-
def add_output_concepts(
|
|
261
|
+
def add_output_concepts(
|
|
262
|
+
self, concepts: List[BuildConcept], rebuild: bool = True, unhide: bool = True
|
|
263
|
+
):
|
|
262
264
|
for concept in concepts:
|
|
263
265
|
if concept.address not in self.output_lcl.addresses:
|
|
264
266
|
self.output_concepts.append(concept)
|
|
267
|
+
if unhide and concept.address in self.hidden_concepts:
|
|
268
|
+
self.hidden_concepts.remove(concept.address)
|
|
265
269
|
self.output_lcl = LooseBuildConceptList(concepts=self.output_concepts)
|
|
266
270
|
if rebuild:
|
|
267
271
|
self.rebuild_cache()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|