relationalai 0.12.0__py3-none-any.whl → 0.12.2__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.
- relationalai/clients/direct_access_client.py +5 -0
- relationalai/clients/snowflake.py +259 -91
- relationalai/clients/types.py +4 -1
- relationalai/clients/use_index_poller.py +96 -55
- relationalai/clients/util.py +9 -0
- relationalai/dsl.py +1 -2
- relationalai/environments/snowbook.py +10 -1
- relationalai/experimental/solvers.py +283 -79
- relationalai/semantics/internal/internal.py +24 -5
- relationalai/semantics/lqp/executor.py +22 -6
- relationalai/semantics/lqp/model2lqp.py +4 -2
- relationalai/semantics/metamodel/executor.py +2 -1
- relationalai/semantics/metamodel/rewrite/flatten.py +8 -7
- relationalai/semantics/reasoners/graph/core.py +1174 -226
- relationalai/semantics/rel/executor.py +30 -12
- relationalai/semantics/sql/executor/snowflake.py +1 -1
- relationalai/tools/cli.py +6 -2
- relationalai/tools/cli_controls.py +334 -352
- relationalai/tools/constants.py +1 -0
- relationalai/tools/query_utils.py +27 -0
- relationalai/util/otel_configuration.py +1 -1
- {relationalai-0.12.0.dist-info → relationalai-0.12.2.dist-info}/METADATA +1 -1
- {relationalai-0.12.0.dist-info → relationalai-0.12.2.dist-info}/RECORD +26 -25
- {relationalai-0.12.0.dist-info → relationalai-0.12.2.dist-info}/WHEEL +0 -0
- {relationalai-0.12.0.dist-info → relationalai-0.12.2.dist-info}/entry_points.txt +0 -0
- {relationalai-0.12.0.dist-info → relationalai-0.12.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -102,6 +102,7 @@ def _get_export_reads(export_ids: list[tuple[lqp.RelationId, int, lqp.Type]]) ->
|
|
|
102
102
|
data_columns=csv_columns,
|
|
103
103
|
compression="gzip",
|
|
104
104
|
partition_size=200,
|
|
105
|
+
syntax_escapechar='"', # To follow Snowflake's expected format
|
|
105
106
|
meta=None,
|
|
106
107
|
)
|
|
107
108
|
reads.append(lqp.Read(read_type=lqp.Export(config=export_csv_config, meta=None), meta=None))
|
|
@@ -579,8 +580,9 @@ def get_relation_id(ctx: TranslationCtx, relation: ir.Relation, projection: list
|
|
|
579
580
|
if relation.id in ctx.def_names.id_to_name:
|
|
580
581
|
unique_name = ctx.def_names.id_to_name[relation.id]
|
|
581
582
|
else:
|
|
582
|
-
|
|
583
|
-
|
|
583
|
+
name = helpers.relation_name_prefix(relation) + relation.name
|
|
584
|
+
name = helpers.sanitize(name)
|
|
585
|
+
unique_name = ctx.def_names.get_name_by_id(relation.id, name)
|
|
584
586
|
|
|
585
587
|
return utils.gen_rel_id(ctx, unique_name, types)
|
|
586
588
|
|
|
@@ -558,22 +558,23 @@ class Flatten(Pass):
|
|
|
558
558
|
def rewrite_wide_output(self, output: ir.Output):
|
|
559
559
|
assert(output.keys)
|
|
560
560
|
|
|
561
|
-
# only
|
|
562
|
-
|
|
561
|
+
# only append keys that are not already in the output
|
|
562
|
+
suffix_keys = []
|
|
563
563
|
for key in output.keys:
|
|
564
564
|
if all([val is not key for _, val in output.aliases]):
|
|
565
|
-
|
|
565
|
+
suffix_keys.append(key)
|
|
566
566
|
|
|
567
567
|
aliases: OrderedSet[Tuple[str, ir.Value]] = ordered_set()
|
|
568
|
-
# add the keys to the output
|
|
569
|
-
for key in prefix_keys:
|
|
570
|
-
aliases.add((key.name, key))
|
|
571
568
|
|
|
572
569
|
# add the remaining args, unless it is already a key
|
|
573
570
|
for name, val in output.aliases:
|
|
574
|
-
if not isinstance(val, ir.Var) or val not in
|
|
571
|
+
if not isinstance(val, ir.Var) or val not in suffix_keys:
|
|
575
572
|
aliases.add((name, val))
|
|
576
573
|
|
|
574
|
+
# add the keys to the output
|
|
575
|
+
for key in suffix_keys:
|
|
576
|
+
aliases.add((key.name, key))
|
|
577
|
+
|
|
577
578
|
# TODO - we are assuming that the Rel compiler will translate nullable lookups
|
|
578
579
|
# properly, returning a `Missing` if necessary, like this:
|
|
579
580
|
# (nested_192(_adult, _adult_name) or (not nested_192(_adult, _) and _adult_name = Missing)) and
|