aepp 0.4.1__tar.gz → 0.4.1.post2__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.
- {aepp-0.4.1/aepp.egg-info → aepp-0.4.1.post2}/PKG-INFO +1 -1
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/__init__.py +6 -0
- aepp-0.4.1.post2/aepp/__version__.py +1 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/classmanager.py +5 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/customerprofile.py +0 -1
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/datatypemanager.py +22 -3
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/fieldgroupmanager.py +23 -3
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/schema.py +3 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/schemamanager.py +4 -8
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/som.py +0 -1
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/synchronizer.py +15 -3
- {aepp-0.4.1 → aepp-0.4.1.post2/aepp.egg-info}/PKG-INFO +1 -1
- aepp-0.4.1/aepp/__version__.py +0 -1
- {aepp-0.4.1 → aepp-0.4.1.post2}/LICENSE +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/MANIFEST.in +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/README.md +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/accesscontrol.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/catalog.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/config.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/configs.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/connector.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/dataaccess.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/dataprep.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/datasets.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/deletion.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/destination.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/destinationinstanceservice.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/edge.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/exportDatasetToDataLandingZone.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/flowservice.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/hygiene.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/identity.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/ingestion.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/observability.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/policy.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/privacyservice.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/queryservice.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/sandboxes.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/segmentation.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/sensei.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/tags.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp/utils.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp.egg-info/SOURCES.txt +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp.egg-info/dependency_links.txt +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp.egg-info/requires.txt +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/aepp.egg-info/top_level.txt +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/setup.cfg +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/setup.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/__init__.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/catalog_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/dataaccess_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/datasets_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/destinationinstanceservice_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/exportDatasetToDatalandingZone_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/flowservice_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/schema_test.py +0 -0
- {aepp-0.4.1 → aepp-0.4.1.post2}/tests/som_test.py +0 -0
|
@@ -400,6 +400,9 @@ def __extractFieldGroup__(fieldGroup: str,folder: Union[str, Path] = None,sandbo
|
|
|
400
400
|
for descriptor in descriptors:
|
|
401
401
|
with open(f"{descriptorPath / descriptor['@id']}.json",'w') as f:
|
|
402
402
|
json.dump(descriptor,f,indent=2)
|
|
403
|
+
classes = myfg_manager.classIds
|
|
404
|
+
for cls in classes:
|
|
405
|
+
__extractClass__(cls,folder,sandbox)
|
|
403
406
|
|
|
404
407
|
def __extractSchema__(schemaEl: str,folder: Union[str, Path] = None,sandbox: 'ConnectObject' = None,region:str=None):
|
|
405
408
|
schemaPath = Path(folder) / 'schema'
|
|
@@ -435,6 +438,9 @@ def __extractSchema__(schemaEl: str,folder: Union[str, Path] = None,sandbox: 'Co
|
|
|
435
438
|
if descriptor.get('@type','') == 'xdm:descriptorIdentity':
|
|
436
439
|
namespace = descriptor['xdm:namespace']
|
|
437
440
|
__extractIdentity__(namespace,region,folder,sandbox)
|
|
441
|
+
if descriptor.get('@type','') == 'xdm:descriptorRelationship' or descriptor.get('@type','') == 'xdm:descriptorOneToOne':
|
|
442
|
+
targetSchema = descriptor['xdm:destinationSchema']
|
|
443
|
+
__extractSchema__(targetSchema,folder,sandbox,region)
|
|
438
444
|
|
|
439
445
|
|
|
440
446
|
def __extractIdentity__(identityStr: str,region:str=None,folder: Union[str, Path] = None,sandbox: 'ConnectObject' = None):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.1-2"
|
|
@@ -682,6 +682,7 @@ class ClassManager:
|
|
|
682
682
|
dictionary['enumValues'] = []
|
|
683
683
|
dictionary['enum'] = []
|
|
684
684
|
dictionary['default'] = []
|
|
685
|
+
dictionary['metaStatus'] = []
|
|
685
686
|
else:
|
|
686
687
|
dictionary = dictionary
|
|
687
688
|
for key in mydict:
|
|
@@ -707,6 +708,7 @@ class ClassManager:
|
|
|
707
708
|
if queryPath or full:
|
|
708
709
|
dictionary["querypath"].append(self.__cleanPath__(tmp_path))
|
|
709
710
|
if full:
|
|
711
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
710
712
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
711
713
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
712
714
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -749,6 +751,7 @@ class ClassManager:
|
|
|
749
751
|
if (queryPath or full) and tmp_path is not None:
|
|
750
752
|
dictionary["querypath"].append(self.__cleanPath__(tmp_path))
|
|
751
753
|
if full:
|
|
754
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
752
755
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
753
756
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
754
757
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -787,6 +790,7 @@ class ClassManager:
|
|
|
787
790
|
if queryPath or full:
|
|
788
791
|
dictionary["querypath"].append(self.__cleanPath__(finalpath))
|
|
789
792
|
if full:
|
|
793
|
+
dictionary['metaStatus'].append(mydict[key]['items'].get('meta:status',pd.NA))
|
|
790
794
|
dictionary['minLength'].append(mydict[key]['items'].get('minLength',np.nan))
|
|
791
795
|
dictionary['maxLength'].append(mydict[key]['items'].get('maxLength',np.nan))
|
|
792
796
|
dictionary['minimum'].append(mydict[key]['items'].get('minimum',np.nan))
|
|
@@ -821,6 +825,7 @@ class ClassManager:
|
|
|
821
825
|
if queryPath or full:
|
|
822
826
|
dictionary["querypath"].append(self.__cleanPath__(finalpath))
|
|
823
827
|
if full:
|
|
828
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
824
829
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
825
830
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
826
831
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -776,7 +776,6 @@ class Profile:
|
|
|
776
776
|
privateHeader['Accept'] = "application/json"
|
|
777
777
|
params = {"offset":0,"limit":20}
|
|
778
778
|
res = self.connector.getData(self.endpoint_global + path,params=params,headers=privateHeader)
|
|
779
|
-
print(res)
|
|
780
779
|
data = res.get("computedAttributes",[])
|
|
781
780
|
offset = res.get("_page",{}).get("offset", 0)
|
|
782
781
|
while offset != 0:
|
|
@@ -548,6 +548,7 @@ class DataTypeManager:
|
|
|
548
548
|
dictionary['enumValues'] = []
|
|
549
549
|
dictionary['enum'] = []
|
|
550
550
|
dictionary['default'] = []
|
|
551
|
+
dictionary['metaStatus'] = []
|
|
551
552
|
else:
|
|
552
553
|
dictionary = dictionary
|
|
553
554
|
for key in mydict:
|
|
@@ -573,6 +574,7 @@ class DataTypeManager:
|
|
|
573
574
|
if queryPath or full:
|
|
574
575
|
dictionary["querypath"].append(self.__cleanPath__(tmp_path))
|
|
575
576
|
if full:
|
|
577
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
576
578
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
577
579
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
578
580
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -615,6 +617,7 @@ class DataTypeManager:
|
|
|
615
617
|
if queryPath or full:
|
|
616
618
|
dictionary["querypath"].append(self.__cleanPath__(tmp_path))
|
|
617
619
|
if full:
|
|
620
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
618
621
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
619
622
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
620
623
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -660,6 +663,7 @@ class DataTypeManager:
|
|
|
660
663
|
if queryPath or full:
|
|
661
664
|
dictionary["querypath"].append(self.__cleanPath__(finalpath))
|
|
662
665
|
if full:
|
|
666
|
+
dictionary['metaStatus'].append(mydict[key]['items'].get('meta:status',pd.NA))
|
|
663
667
|
dictionary['minLength'].append(mydict[key]['items'].get('minLength',np.nan))
|
|
664
668
|
dictionary['maxLength'].append(mydict[key]['items'].get('maxLength',np.nan))
|
|
665
669
|
dictionary['minimum'].append(mydict[key]['items'].get('minimum',np.nan))
|
|
@@ -697,6 +701,7 @@ class DataTypeManager:
|
|
|
697
701
|
if queryPath or full:
|
|
698
702
|
dictionary["querypath"].append(self.__cleanPath__(finalpath))
|
|
699
703
|
if full:
|
|
704
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
700
705
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
701
706
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
702
707
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -1099,6 +1104,7 @@ class DataTypeManager:
|
|
|
1099
1104
|
minLength : if you want to add a minimum length for string field
|
|
1100
1105
|
maxLength : if you want to add a maximum length for string field
|
|
1101
1106
|
default : if you want to add a default value for the field
|
|
1107
|
+
metaStatus : if you want to add a meta:status value for the field
|
|
1102
1108
|
"""
|
|
1103
1109
|
if self.EDITABLE == False:
|
|
1104
1110
|
raise Exception("The Data Type is not Editable via Field Group Manager")
|
|
@@ -1116,6 +1122,7 @@ class DataTypeManager:
|
|
|
1116
1122
|
del pathSplit[0]
|
|
1117
1123
|
newField = pathSplit.pop()
|
|
1118
1124
|
description = kwargs.get("description",'')
|
|
1125
|
+
metaStatus = kwargs.get("metaStatus",None)
|
|
1119
1126
|
obj = {}
|
|
1120
1127
|
if dataType == 'object':
|
|
1121
1128
|
if objectComponents is not None:
|
|
@@ -1126,6 +1133,8 @@ class DataTypeManager:
|
|
|
1126
1133
|
obj = { 'type':'object', 'title':title, "description":description,
|
|
1127
1134
|
'properties':{}
|
|
1128
1135
|
}
|
|
1136
|
+
if metaStatus is not None:
|
|
1137
|
+
obj['meta:status'] = metaStatus
|
|
1129
1138
|
elif dataType == 'array':
|
|
1130
1139
|
if objectComponents is not None:
|
|
1131
1140
|
obj = { 'type':'array', 'title':title,"description":description,
|
|
@@ -1141,6 +1150,8 @@ class DataTypeManager:
|
|
|
1141
1150
|
'properties':{}
|
|
1142
1151
|
}
|
|
1143
1152
|
}
|
|
1153
|
+
if metaStatus is not None:
|
|
1154
|
+
obj['meta:status'] = metaStatus
|
|
1144
1155
|
elif dataType == "dataType":
|
|
1145
1156
|
obj = {'$ref': ref,
|
|
1146
1157
|
'required': [],
|
|
@@ -1156,6 +1167,8 @@ class DataTypeManager:
|
|
|
1156
1167
|
"$ref" : ref,
|
|
1157
1168
|
"title":title
|
|
1158
1169
|
}
|
|
1170
|
+
if metaStatus is not None:
|
|
1171
|
+
obj['meta:status'] = metaStatus
|
|
1159
1172
|
self.dataTypes[ref] = title
|
|
1160
1173
|
self.dataTypeManagers[ref] = DataTypeManager(dataType=ref,schemaAPI=self.schemaAPI)
|
|
1161
1174
|
elif dataType == "map":
|
|
@@ -1172,6 +1185,8 @@ class DataTypeManager:
|
|
|
1172
1185
|
obj['additionalProperties']['maximum'] = 2147483647
|
|
1173
1186
|
obj['additionalProperties']['minimum'] = -2147483648
|
|
1174
1187
|
obj['additionalProperties']['meta:xdmType'] = "int"
|
|
1188
|
+
if metaStatus is not None:
|
|
1189
|
+
obj['meta:status'] = metaStatus
|
|
1175
1190
|
else:
|
|
1176
1191
|
minimum = kwargs.get('minimum',None)
|
|
1177
1192
|
maximum = kwargs.get('maximum',None)
|
|
@@ -1181,6 +1196,9 @@ class DataTypeManager:
|
|
|
1181
1196
|
default = kwargs.get('default',None)
|
|
1182
1197
|
obj = self.__transformFieldType__(dataType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1183
1198
|
obj['title']= title
|
|
1199
|
+
obj['description']= description
|
|
1200
|
+
if metaStatus is not None:
|
|
1201
|
+
obj['meta:status'] = metaStatus
|
|
1184
1202
|
if array:
|
|
1185
1203
|
obj['type'] = "array"
|
|
1186
1204
|
obj['items'] = self.__transformFieldType__(dataType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
@@ -1431,17 +1449,18 @@ class DataTypeManager:
|
|
|
1431
1449
|
pattern = (lambda x : None if pd.isnull(x) else x)(row.get('pattern',None))
|
|
1432
1450
|
default = (lambda x : None if pd.isnull(x) else x)(row.get('default',None))
|
|
1433
1451
|
enumValues = (lambda x : None if pd.isnull(x) else x)(row.get('enumValues',None))
|
|
1452
|
+
metastatus = (lambda x : None if pd.isnull(x) else x)(row.get('metaStatus',None))
|
|
1434
1453
|
if enumValues is None: ## ensuring to forcing a suggested value for empty enumValues
|
|
1435
1454
|
enumType = None
|
|
1436
1455
|
else:
|
|
1437
1456
|
enumType = row.get('enum',False)
|
|
1438
1457
|
if path.endswith("[]"):
|
|
1439
1458
|
clean_path = self.__cleanPath__(row['path'])
|
|
1440
|
-
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1459
|
+
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metastatus=metastatus)
|
|
1441
1460
|
elif path.endswith("[]{}"):
|
|
1442
1461
|
clean_path = self.__cleanPath__(row['path'])
|
|
1443
|
-
self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1462
|
+
self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metastatus=metastatus)
|
|
1444
1463
|
else:
|
|
1445
1464
|
clean_path = self.__cleanPath__(row['path'])
|
|
1446
|
-
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1465
|
+
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metastatus=metastatus)
|
|
1447
1466
|
return self
|
|
@@ -639,6 +639,7 @@ class FieldGroupManager:
|
|
|
639
639
|
dictionary['enumValues'] = []
|
|
640
640
|
dictionary['enum'] = []
|
|
641
641
|
dictionary['default'] = []
|
|
642
|
+
dictionary['metaStatus'] = []
|
|
642
643
|
else:
|
|
643
644
|
dictionary = dictionary
|
|
644
645
|
for key in mydict:
|
|
@@ -661,6 +662,7 @@ class FieldGroupManager:
|
|
|
661
662
|
if queryPath or full:
|
|
662
663
|
dictionary["querypath"].append(self.__cleanPath__(tmp_path))
|
|
663
664
|
if full:
|
|
665
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
664
666
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
665
667
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
666
668
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -703,6 +705,7 @@ class FieldGroupManager:
|
|
|
703
705
|
if (queryPath or full) and tmp_path is not None:
|
|
704
706
|
dictionary["querypath"].append(self.__cleanPath__(tmp_path))
|
|
705
707
|
if full:
|
|
708
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
706
709
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
707
710
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
708
711
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -748,6 +751,7 @@ class FieldGroupManager:
|
|
|
748
751
|
if (queryPath or full) and finalpath is not None:
|
|
749
752
|
dictionary["querypath"].append(self.__cleanPath__(finalpath))
|
|
750
753
|
if full:
|
|
754
|
+
dictionary['metaStatus'].append(mydict[key]['items'].get('meta:status',pd.NA))
|
|
751
755
|
dictionary['minLength'].append(mydict[key]['items'].get('minLength',np.nan))
|
|
752
756
|
dictionary['maxLength'].append(mydict[key]['items'].get('maxLength',np.nan))
|
|
753
757
|
dictionary['minimum'].append(mydict[key]['items'].get('minimum',np.nan))
|
|
@@ -785,6 +789,7 @@ class FieldGroupManager:
|
|
|
785
789
|
if (queryPath or full) and finalpath is not None:
|
|
786
790
|
dictionary["querypath"].append(self.__cleanPath__(finalpath))
|
|
787
791
|
if full:
|
|
792
|
+
dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
|
|
788
793
|
dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
|
|
789
794
|
dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
|
|
790
795
|
dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
|
|
@@ -1151,6 +1156,7 @@ class FieldGroupManager:
|
|
|
1151
1156
|
minLength : if you want to add a minimum length for string field
|
|
1152
1157
|
maxLength : if you want to add a maximum length for string field
|
|
1153
1158
|
default : if you want to add a default value for the field
|
|
1159
|
+
metaStatus : if you want to add a meta:status attribute to the field
|
|
1154
1160
|
"""
|
|
1155
1161
|
if self.EDITABLE == False:
|
|
1156
1162
|
raise Exception("The Field Group is not Editable via Field Group Manager")
|
|
@@ -1171,6 +1177,7 @@ class FieldGroupManager:
|
|
|
1171
1177
|
del pathSplit[0]
|
|
1172
1178
|
newField = pathSplit.pop()
|
|
1173
1179
|
description = kwargs.get("description",'')
|
|
1180
|
+
metaStatus = kwargs.get('metaStatus',None)
|
|
1174
1181
|
if dataType == 'object':
|
|
1175
1182
|
if array==False:
|
|
1176
1183
|
if objectComponents is not None:
|
|
@@ -1181,6 +1188,8 @@ class FieldGroupManager:
|
|
|
1181
1188
|
obj = { 'type':'object', 'title':title, "description":description,
|
|
1182
1189
|
'properties':{}
|
|
1183
1190
|
}
|
|
1191
|
+
if metaStatus is not None:
|
|
1192
|
+
obj['meta:status'] = metaStatus
|
|
1184
1193
|
else:
|
|
1185
1194
|
if objectComponents is not None:
|
|
1186
1195
|
obj = { 'type':'array', 'title':title, "description":description,
|
|
@@ -1196,6 +1205,8 @@ class FieldGroupManager:
|
|
|
1196
1205
|
'properties':{}
|
|
1197
1206
|
}
|
|
1198
1207
|
}
|
|
1208
|
+
if metaStatus is not None:
|
|
1209
|
+
obj['meta:status'] = metaStatus
|
|
1199
1210
|
elif dataType == 'array':
|
|
1200
1211
|
if objectComponents is not None:
|
|
1201
1212
|
obj = { 'type':'array', 'title':title,"description":description,
|
|
@@ -1211,6 +1222,8 @@ class FieldGroupManager:
|
|
|
1211
1222
|
'properties':{}
|
|
1212
1223
|
}
|
|
1213
1224
|
}
|
|
1225
|
+
if metaStatus is not None:
|
|
1226
|
+
obj['meta:status'] = metaStatus
|
|
1214
1227
|
elif dataType == "dataType":
|
|
1215
1228
|
obj = {'$ref': ref,
|
|
1216
1229
|
'required': [],
|
|
@@ -1226,6 +1239,8 @@ class FieldGroupManager:
|
|
|
1226
1239
|
"$ref" : ref,
|
|
1227
1240
|
"title":title
|
|
1228
1241
|
}
|
|
1242
|
+
if metaStatus is not None:
|
|
1243
|
+
obj['meta:status'] = metaStatus
|
|
1229
1244
|
self.dataTypes[ref] = title
|
|
1230
1245
|
self.dataTypeManagers[ref] = DataTypeManager(dataType=ref,schemaAPI=self.schemaAPI,localFolder=self.localfolder,tenantId=self.tenantId,sandbox=self.sandbox)
|
|
1231
1246
|
elif dataType == "map":
|
|
@@ -1242,6 +1257,8 @@ class FieldGroupManager:
|
|
|
1242
1257
|
obj['additionalProperties']['maximum'] = 2147483647
|
|
1243
1258
|
obj['additionalProperties']['minimum'] = -2147483648
|
|
1244
1259
|
obj['additionalProperties']['meta:xdmType'] = "int"
|
|
1260
|
+
if metaStatus is not None:
|
|
1261
|
+
obj['meta:status'] = metaStatus
|
|
1245
1262
|
else:
|
|
1246
1263
|
minimum = kwargs.get('minimum',None)
|
|
1247
1264
|
maximum = kwargs.get('maximum',None)
|
|
@@ -1252,6 +1269,8 @@ class FieldGroupManager:
|
|
|
1252
1269
|
obj = self.__transformFieldType__(dataType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1253
1270
|
obj['title'] = title
|
|
1254
1271
|
obj["description"] = description,
|
|
1272
|
+
if metaStatus is not None:
|
|
1273
|
+
obj['meta:status'] = metaStatus
|
|
1255
1274
|
if type(obj["description"]) == tuple:
|
|
1256
1275
|
obj["description"] = obj["description"][0]
|
|
1257
1276
|
if array:
|
|
@@ -1640,19 +1659,20 @@ class FieldGroupManager:
|
|
|
1640
1659
|
pattern = (lambda x : None if pd.isnull(x) else x)(row.get('pattern',None))
|
|
1641
1660
|
default = (lambda x : None if pd.isnull(x) else x)(row.get('default',None))
|
|
1642
1661
|
enumValues = (lambda x : None if pd.isnull(x) else x)(row.get('enumValues',None))
|
|
1662
|
+
metaStatus = (lambda x : None if pd.isnull(x) else x)(row.get('metaStatus',None))
|
|
1643
1663
|
if enumValues is None: ## ensuring to forcing a suggested value for empty enumValues
|
|
1644
1664
|
enumType = None
|
|
1645
1665
|
else:
|
|
1646
1666
|
enumType = row.get('enum',False)
|
|
1647
1667
|
if path.endswith("[]"):
|
|
1648
1668
|
clean_path = self.__cleanPath__(row['path'])
|
|
1649
|
-
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1669
|
+
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metaStatus=metaStatus)
|
|
1650
1670
|
elif path.endswith("[]{}"):
|
|
1651
1671
|
clean_path = self.__cleanPath__(row['path'])
|
|
1652
|
-
self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1672
|
+
self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metaStatus=metaStatus)
|
|
1653
1673
|
else:
|
|
1654
1674
|
clean_path = self.__cleanPath__(row['path'])
|
|
1655
|
-
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
|
|
1675
|
+
self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metaStatus=metaStatus)
|
|
1656
1676
|
if title is not None:
|
|
1657
1677
|
self.setTitle(title)
|
|
1658
1678
|
elif 'fieldGroup' in df_import.columns:
|
|
@@ -1765,6 +1765,9 @@ class Schema:
|
|
|
1765
1765
|
raise Exception("Require a field Group ID")
|
|
1766
1766
|
if self.loggingEnabled:
|
|
1767
1767
|
self.logger.debug(f"Starting extendFieldGroup")
|
|
1768
|
+
if fieldGroupId.startswith("https://"):
|
|
1769
|
+
from urllib import parse
|
|
1770
|
+
fieldGroupId = parse.quote_plus(fieldGroupId)
|
|
1768
1771
|
path = f"/{tenant}/fieldgroups/{fieldGroupId}"
|
|
1769
1772
|
if values is not None:
|
|
1770
1773
|
list_fgs = values
|
|
@@ -122,9 +122,7 @@ class SchemaManager:
|
|
|
122
122
|
break
|
|
123
123
|
self.fieldGroupIds = [obj['$ref'] for obj in allOf if ('/mixins/' in obj['$ref'] or '/experience/' in obj['$ref'] or '/context/' in obj['$ref']) and obj['$ref'] != self.classId]
|
|
124
124
|
self.classIds = [self.classId]
|
|
125
|
-
print(self.tenantId)
|
|
126
125
|
for ref in self.fieldGroupIds:
|
|
127
|
-
print(ref)
|
|
128
126
|
if '/mixins/' in ref and self.tenantId[1:] in ref:
|
|
129
127
|
if self.localfolder is not None:
|
|
130
128
|
for json_file in self.fieldgroupFolder.glob('*.json'):
|
|
@@ -134,7 +132,6 @@ class SchemaManager:
|
|
|
134
132
|
break
|
|
135
133
|
elif self.schemaAPI is not None:
|
|
136
134
|
definition = self.schemaAPI.getFieldGroup(ref,full=False)
|
|
137
|
-
print(definition.get('title'))
|
|
138
135
|
fgM = FieldGroupManager(fieldGroup=definition,schemaAPI=self.schemaAPI,localFolder=localFolder,tenantId=self.tenantId,sandbox=self.sandbox)
|
|
139
136
|
else:
|
|
140
137
|
if self.localfolder is not None:
|
|
@@ -206,7 +203,6 @@ class SchemaManager:
|
|
|
206
203
|
tmp_def = json.load(FileIO(json_file))
|
|
207
204
|
if tmp_def.get('$id') == ref:
|
|
208
205
|
definition = tmp_def
|
|
209
|
-
print(definition.get('title'))
|
|
210
206
|
break
|
|
211
207
|
if 'properties' in definition.keys():
|
|
212
208
|
definition['definitions'] = definition['properties']
|
|
@@ -260,7 +256,6 @@ class SchemaManager:
|
|
|
260
256
|
tmp_def = json.load(FileIO(json_file))
|
|
261
257
|
if tmp_def.get('$id') == ref:
|
|
262
258
|
definition = tmp_def
|
|
263
|
-
print(definition.get('title'))
|
|
264
259
|
break
|
|
265
260
|
fgM = FieldGroupManager(definition,schemaAPI=self.schemaAPI, localFolder=localFolder,tenantId=self.tenantId,sandbox=self.sandbox)
|
|
266
261
|
self.fieldGroupsManagers[fgM.title] = fgM
|
|
@@ -585,7 +580,6 @@ class SchemaManager:
|
|
|
585
580
|
res = self.schemaAPI.putSchema(self.id,self.schema)
|
|
586
581
|
if 'status' in res.keys():
|
|
587
582
|
if res['status'] == 400:
|
|
588
|
-
print(res['title'])
|
|
589
583
|
return res
|
|
590
584
|
else:
|
|
591
585
|
return res
|
|
@@ -600,6 +594,7 @@ class SchemaManager:
|
|
|
600
594
|
alternateTitle:str="",
|
|
601
595
|
alternateDescription:str=None,
|
|
602
596
|
alternateNote:str="",
|
|
597
|
+
alternateEnum:str="",
|
|
603
598
|
targetSchema:str=None,
|
|
604
599
|
targetCompletePath:str=None,
|
|
605
600
|
targetNamespace:str=None,
|
|
@@ -621,6 +616,7 @@ class SchemaManager:
|
|
|
621
616
|
alternateTitle : OPTIONAL : if the descriptor is alternateDisplay, the alternate title to be used.
|
|
622
617
|
alternateDescription : OPTIONAL if you wish to add a new description.
|
|
623
618
|
alternateNote : OPTIONAL : if you wish to add a new note.
|
|
619
|
+
alternateEnum : OPTIONAL : if you wish to add a new enum limitation.
|
|
624
620
|
targetSchema : OPTIONAL : The schema ID for the destination (lookup, B2B lookup, relationship) if the descriptor is "descriptorRelationship" or "descriptorOneToOne".
|
|
625
621
|
targetCompletePath : OPTIONAL : if you have the complete path for the field in the target lookup schema, if the descriptor is "descriptorRelationship" or "descriptorOneToOne".
|
|
626
622
|
targetNamespace: OPTIONAL : if you have the namespace code for the target schema (used for "descriptorRelationship").
|
|
@@ -647,8 +643,6 @@ class SchemaManager:
|
|
|
647
643
|
"xdm:isPrimary": identityPrimary
|
|
648
644
|
}
|
|
649
645
|
elif descType == "xdm:alternateDisplayInfo":
|
|
650
|
-
if alternateTitle is None:
|
|
651
|
-
raise ValueError("Require an alternate title")
|
|
652
646
|
obj = {
|
|
653
647
|
"@type": descType,
|
|
654
648
|
"xdm:sourceSchema": self.id,
|
|
@@ -667,6 +661,8 @@ class SchemaManager:
|
|
|
667
661
|
obj["xdm:note"] = {
|
|
668
662
|
"en_us":alternateNote
|
|
669
663
|
}
|
|
664
|
+
if alternateEnum is not None:
|
|
665
|
+
obj["xdm:excludeMetaEnum"] = alternateEnum
|
|
670
666
|
elif descType == "xdm:descriptorOneToOne":
|
|
671
667
|
obj = {
|
|
672
668
|
"@type": descType,
|
|
@@ -340,6 +340,11 @@ class Synchronizer:
|
|
|
340
340
|
print(f"field group '{name_base_fieldgroup}' already exists in target {target}, checking it")
|
|
341
341
|
if t_fieldgroup is None: ## if need to create the FieldGroupManager
|
|
342
342
|
t_fieldgroup = fieldgroupmanager.FieldGroupManager(targetSchema.data.fieldGroups_altId[name_base_fieldgroup],config=self.dict_targetsConfig[target],sandbox=target)
|
|
343
|
+
for fg_class in t_fieldgroup.classIds:
|
|
344
|
+
if fg_class not in fg_class_ids:
|
|
345
|
+
fg_class_ids.append(fg_class)
|
|
346
|
+
### Aligning class support to the field groups
|
|
347
|
+
t_fieldgroup.schemaAPI.extendFieldGroup(t_fieldgroup.id,fg_class_ids)
|
|
343
348
|
df_base = baseFieldGroup.to_dataframe(full=True)
|
|
344
349
|
df_target = t_fieldgroup.to_dataframe(full=True)
|
|
345
350
|
base_paths = df_base['path'].tolist()
|
|
@@ -515,6 +520,8 @@ class Synchronizer:
|
|
|
515
520
|
## adding the field group to the target components
|
|
516
521
|
self.dict_targetComponents[target]['fieldgroup'][fg_name] = fieldgroupmanager.FieldGroupManager(dict_base_fg_name_id[fg_name],config=self.dict_targetsConfig[target],sandbox=target)
|
|
517
522
|
else:
|
|
523
|
+
if verbose:
|
|
524
|
+
print(f"field group '{fg_name}' is a custom field group, using it")
|
|
518
525
|
tmp_FieldGroup = baseSchema.getFieldGroupManager(fg_name)
|
|
519
526
|
self.__syncFieldGroup__(tmp_FieldGroup,verbose=verbose)
|
|
520
527
|
new_schema.addFieldGroup(self.dict_targetComponents[target]['fieldgroup'][fg_name].id)
|
|
@@ -643,25 +650,30 @@ class Synchronizer:
|
|
|
643
650
|
case "xdm:alternateDisplayInfo":
|
|
644
651
|
target_alternateDisplayInfo = [desc for desc in target_descriptors if desc['@type'] == 'xdm:alternateDisplayInfo']
|
|
645
652
|
alternateTitle = baseDescriptor.get('xdm:title',{}).get('en_us',None)
|
|
653
|
+
alternateDescription = baseDescriptor.get('xdm:description',{}).get('en_us',None)
|
|
654
|
+
alternateDescription = baseDescriptor.get('xdm:description',{}).get('en_us',None)
|
|
646
655
|
alternateNote = baseDescriptor.get('xdm:note',{}).get('en_us',None)
|
|
656
|
+
alternateEnum = baseDescriptor.get('xdm:excludeMetaEnum',None)
|
|
647
657
|
alternateDescription = baseDescriptor.get('xdm:description',{}).get('en_us',None)
|
|
648
658
|
if baseDescriptor['xdm:sourceProperty'] not in [el['xdm:sourceProperty'] for el in target_alternateDisplayInfo]: ## descriptor does not exists in target
|
|
649
659
|
new_desc = targetSchemaManager.createDescriptorOperation(descType=descType,
|
|
650
660
|
completePath=baseDescriptor['xdm:sourceProperty'],
|
|
651
661
|
alternateTitle=alternateTitle,alternateDescription=alternateDescription,
|
|
652
|
-
alternateNote=alternateNote)
|
|
662
|
+
alternateNote=alternateNote,alternateEnum=alternateEnum)
|
|
653
663
|
res = targetSchemaManager.createDescriptor(new_desc)
|
|
654
664
|
else: ## descriptor already exists in target
|
|
655
665
|
res = [el for el in target_alternateDisplayInfo if el['xdm:sourceProperty'] == baseDescriptor['xdm:sourceProperty']][0]
|
|
656
666
|
target_alternateTitle = res.get('xdm:title',{}).get('en_us',None)
|
|
657
667
|
target_alternateNote = res.get('xdm:note',{}).get('en_us',None)
|
|
658
668
|
target_alternateDescription = res.get('xdm:description',{}).get('en_us',None)
|
|
669
|
+
target_alternateNote = baseDescriptor.get('xdm:note',{}).get('en_us',None)
|
|
670
|
+
target_alternateEnum = baseDescriptor.get('xdm:excludeMetaEnum',None)
|
|
659
671
|
## check if the alternateTitle, alternateNote and alternateDescription are the same
|
|
660
|
-
if target_alternateTitle != alternateTitle or target_alternateNote != alternateNote or target_alternateDescription != alternateDescription:
|
|
672
|
+
if target_alternateTitle != alternateTitle or target_alternateNote != alternateNote or target_alternateDescription != alternateDescription or str(target_alternateEnum) != str(alternateEnum):
|
|
661
673
|
new_desc = targetSchemaManager.createDescriptorOperation(descType=descType,
|
|
662
674
|
completePath=baseDescriptor['xdm:sourceProperty'],
|
|
663
675
|
alternateTitle=alternateTitle,alternateDescription=alternateDescription,
|
|
664
|
-
alternateNote=alternateNote)
|
|
676
|
+
alternateNote=alternateNote,alternateEnum=alternateEnum)
|
|
665
677
|
res = targetSchemaManager.updateDescriptor(new_def)
|
|
666
678
|
list_descriptors.append(res)
|
|
667
679
|
case "xdm:descriptorReferenceIdentity": ## can be referenced by other schemas
|
aepp-0.4.1/aepp/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.1"
|
|
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
|