pytrilogy 0.0.2.19__py3-none-any.whl → 0.0.2.20__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.2.19.dist-info → pytrilogy-0.0.2.20.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.2.19.dist-info → pytrilogy-0.0.2.20.dist-info}/RECORD +9 -9
- trilogy/__init__.py +1 -1
- trilogy/core/models.py +17 -25
- trilogy/parsing/parse_engine.py +7 -2
- {pytrilogy-0.0.2.19.dist-info → pytrilogy-0.0.2.20.dist-info}/LICENSE.md +0 -0
- {pytrilogy-0.0.2.19.dist-info → pytrilogy-0.0.2.20.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.2.19.dist-info → pytrilogy-0.0.2.20.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.2.19.dist-info → pytrilogy-0.0.2.20.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
trilogy/__init__.py,sha256=
|
|
1
|
+
trilogy/__init__.py,sha256=jkM9h2qEkIh-R8xZca7g_Qzl5cC8w48aOmkcJUjjTAs,291
|
|
2
2
|
trilogy/compiler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
trilogy/constants.py,sha256=pZkOneh_65f9Ua6NICu1bHAFAbmQxmiXRXS7tsmCWbQ,1235
|
|
4
4
|
trilogy/engine.py,sha256=R5ubIxYyrxRExz07aZCUfrTsoXCHQ8DKFTDsobXdWdA,1102
|
|
@@ -16,7 +16,7 @@ trilogy/core/exceptions.py,sha256=NvV_4qLOgKXbpotgRf7c8BANDEvHxlqRPaA53IThQ2o,56
|
|
|
16
16
|
trilogy/core/functions.py,sha256=ShFTStIKbgI-3EZIU0xTumI78AC5QlvARwnBM53P2O0,10677
|
|
17
17
|
trilogy/core/graph_models.py,sha256=oJUMSpmYhqXlavckHLpR07GJxuQ8dZ1VbB1fB0KaS8c,2036
|
|
18
18
|
trilogy/core/internal.py,sha256=jNGFHKENnbMiMCtAgsnLZYVSENDK4b5ALecXFZpTDzQ,1075
|
|
19
|
-
trilogy/core/models.py,sha256=
|
|
19
|
+
trilogy/core/models.py,sha256=O1_HxOQ0muMbjWVcOH1mmEFG3IM7taaPgfgCnZv21W8,150676
|
|
20
20
|
trilogy/core/optimization.py,sha256=od_60A9F8J8Nj24MHgrxl4vwRwmBFH13TMdoMQvgVKs,7717
|
|
21
21
|
trilogy/core/query_processor.py,sha256=kXuBsIaRHu1s7zB_rAnT_gRe4-VgRSrPE1TnVJXFLtc,16447
|
|
22
22
|
trilogy/core/optimizations/__init__.py,sha256=bWQecbeiwiDx9LJnLsa7dkWxdbl2wcnkcTN69JyP8iI,356
|
|
@@ -70,14 +70,14 @@ trilogy/parsing/common.py,sha256=-4LM71ocidA8DI2RngqFEOmhzBrIt8VdBTO4x2BpD8E,950
|
|
|
70
70
|
trilogy/parsing/config.py,sha256=Z-DaefdKhPDmSXLgg5V4pebhSB0h590vI0_VtHnlukI,111
|
|
71
71
|
trilogy/parsing/exceptions.py,sha256=92E5i2frv5hj9wxObJZsZqj5T6bglvPzvdvco_vW1Zk,38
|
|
72
72
|
trilogy/parsing/helpers.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
73
|
-
trilogy/parsing/parse_engine.py,sha256=
|
|
73
|
+
trilogy/parsing/parse_engine.py,sha256=_orHmZTdExJYkuNRmAaazdXpZcvtPMLKIBI9vBAgq6w,64871
|
|
74
74
|
trilogy/parsing/render.py,sha256=8yxerPAi4AhlhPBlAfbYbOM3F9rz6HzpWVEWPtK2VEg,12321
|
|
75
75
|
trilogy/parsing/trilogy.lark,sha256=0JAvQBACFNL-X61I0tB_0QPZgsguZgerfHBv903oKh0,11623
|
|
76
76
|
trilogy/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
77
|
trilogy/scripts/trilogy.py,sha256=PHxvv6f2ODv0esyyhWxlARgra8dVhqQhYl0lTrSyVNo,3729
|
|
78
|
-
pytrilogy-0.0.2.
|
|
79
|
-
pytrilogy-0.0.2.
|
|
80
|
-
pytrilogy-0.0.2.
|
|
81
|
-
pytrilogy-0.0.2.
|
|
82
|
-
pytrilogy-0.0.2.
|
|
83
|
-
pytrilogy-0.0.2.
|
|
78
|
+
pytrilogy-0.0.2.20.dist-info/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
79
|
+
pytrilogy-0.0.2.20.dist-info/METADATA,sha256=pmZ2uTW1EBclZPel8B698DU3sdTmutM5vnu25tNTHfM,8132
|
|
80
|
+
pytrilogy-0.0.2.20.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
81
|
+
pytrilogy-0.0.2.20.dist-info/entry_points.txt,sha256=0petKryjvvtEfTlbZC1AuMFumH_WQ9v8A19LvoS6G6c,54
|
|
82
|
+
pytrilogy-0.0.2.20.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
83
|
+
pytrilogy-0.0.2.20.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
trilogy/core/models.py
CHANGED
|
@@ -559,19 +559,16 @@ class Concept(Mergeable, Namespaced, SelectContext, BaseModel):
|
|
|
559
559
|
grain = ",".join([str(c.address) for c in self.grain.components])
|
|
560
560
|
return f"{self.namespace}.{self.name}<{grain}>"
|
|
561
561
|
|
|
562
|
-
@
|
|
562
|
+
@cached_property
|
|
563
563
|
def address(self) -> str:
|
|
564
|
-
|
|
565
|
-
self._address_cache = f"{self.namespace}.{self.name}"
|
|
566
|
-
return self._address_cache
|
|
567
|
-
|
|
568
|
-
@address.setter
|
|
569
|
-
def address(self, address: str) -> None:
|
|
570
|
-
self._address_cache = address
|
|
564
|
+
return f"{self.namespace}.{self.name}"
|
|
571
565
|
|
|
572
566
|
def set_name(self, name: str):
|
|
573
567
|
self.name = name
|
|
574
|
-
|
|
568
|
+
try:
|
|
569
|
+
del self.address
|
|
570
|
+
except AttributeError:
|
|
571
|
+
pass
|
|
575
572
|
|
|
576
573
|
@property
|
|
577
574
|
def output(self) -> "Concept":
|
|
@@ -3260,23 +3257,13 @@ class Environment(BaseModel):
|
|
|
3260
3257
|
for datasource in self.datasources.values():
|
|
3261
3258
|
for concept in datasource.output_concepts:
|
|
3262
3259
|
concrete_addresses.add(concept.address)
|
|
3263
|
-
current_mat = [x.address for x in self.materialized_concepts]
|
|
3264
3260
|
self.materialized_concepts = [
|
|
3265
3261
|
c for c in self.concepts.values() if c.address in concrete_addresses
|
|
3266
|
-
]
|
|
3267
|
-
# include aliased concepts
|
|
3268
|
-
self.materialized_concepts += [
|
|
3262
|
+
] + [
|
|
3269
3263
|
c
|
|
3270
3264
|
for c in self.alias_origin_lookup.values()
|
|
3271
3265
|
if c.address in concrete_addresses
|
|
3272
3266
|
]
|
|
3273
|
-
new = [
|
|
3274
|
-
x.address
|
|
3275
|
-
for x in self.materialized_concepts
|
|
3276
|
-
if x.address not in current_mat
|
|
3277
|
-
]
|
|
3278
|
-
if new:
|
|
3279
|
-
logger.debug(f"Environment added new materialized concepts {new}")
|
|
3280
3267
|
|
|
3281
3268
|
def validate_concept(self, lookup: str, meta: Meta | None = None):
|
|
3282
3269
|
existing: Concept = self.concepts.get(lookup) # type: ignore
|
|
@@ -3400,6 +3387,7 @@ class Environment(BaseModel):
|
|
|
3400
3387
|
meta: Meta | None = None,
|
|
3401
3388
|
force: bool = False,
|
|
3402
3389
|
add_derived: bool = True,
|
|
3390
|
+
_ignore_cache: bool = False,
|
|
3403
3391
|
):
|
|
3404
3392
|
if not force:
|
|
3405
3393
|
self.validate_concept(concept.address, meta=meta)
|
|
@@ -3410,13 +3398,15 @@ class Environment(BaseModel):
|
|
|
3410
3398
|
from trilogy.core.environment_helpers import generate_related_concepts
|
|
3411
3399
|
|
|
3412
3400
|
generate_related_concepts(concept, self, meta=meta, add_derived=add_derived)
|
|
3413
|
-
|
|
3401
|
+
if not _ignore_cache:
|
|
3402
|
+
self.gen_concept_list_caches()
|
|
3414
3403
|
return concept
|
|
3415
3404
|
|
|
3416
3405
|
def add_datasource(
|
|
3417
3406
|
self,
|
|
3418
3407
|
datasource: Datasource,
|
|
3419
3408
|
meta: Meta | None = None,
|
|
3409
|
+
_ignore_cache: bool = False,
|
|
3420
3410
|
):
|
|
3421
3411
|
|
|
3422
3412
|
self.datasources[datasource.env_label] = datasource
|
|
@@ -3428,11 +3418,13 @@ class Environment(BaseModel):
|
|
|
3428
3418
|
new_concept.set_name("_pre_persist_" + current_concept.name)
|
|
3429
3419
|
# remove the associated lineage
|
|
3430
3420
|
current_concept.lineage = None
|
|
3431
|
-
self.add_concept(new_concept, meta=meta, force=True)
|
|
3432
|
-
self.add_concept(
|
|
3421
|
+
self.add_concept(new_concept, meta=meta, force=True, _ignore_cache=True)
|
|
3422
|
+
self.add_concept(
|
|
3423
|
+
current_concept, meta=meta, force=True, _ignore_cache=True
|
|
3424
|
+
)
|
|
3433
3425
|
self.merge_concept(new_concept, current_concept, [])
|
|
3434
|
-
|
|
3435
|
-
|
|
3426
|
+
if not _ignore_cache:
|
|
3427
|
+
self.gen_concept_list_caches()
|
|
3436
3428
|
return datasource
|
|
3437
3429
|
|
|
3438
3430
|
def delete_datasource(
|
trilogy/parsing/parse_engine.py
CHANGED
|
@@ -814,14 +814,19 @@ class ParseToObjects(Transformer):
|
|
|
814
814
|
raise ImportError(f"Unable to import file {target}, parsing error: {e}")
|
|
815
815
|
|
|
816
816
|
for _, concept in nparser.environment.concepts.items():
|
|
817
|
-
self.environment.add_concept(
|
|
817
|
+
self.environment.add_concept(
|
|
818
|
+
concept.with_namespace(alias), _ignore_cache=True
|
|
819
|
+
)
|
|
818
820
|
|
|
819
821
|
for _, datasource in nparser.environment.datasources.items():
|
|
820
|
-
self.environment.add_datasource(
|
|
822
|
+
self.environment.add_datasource(
|
|
823
|
+
datasource.with_namespace(alias), _ignore_cache=True
|
|
824
|
+
)
|
|
821
825
|
imps = ImportStatement(
|
|
822
826
|
alias=alias, path=Path(args[0]), environment=nparser.environment
|
|
823
827
|
)
|
|
824
828
|
self.environment.imports[alias] = imps
|
|
829
|
+
self.environment.gen_concept_list_caches()
|
|
825
830
|
return imps
|
|
826
831
|
|
|
827
832
|
@v_args(meta=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|