serJD commited on
Commit
d16b0da
·
verified ·
1 Parent(s): 213206f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -83,8 +83,12 @@ def mainFunc(STREAM_ID, SOURCE_BRANCH, TARGET_BRANCH, UUID_COL, ATTR_METADATA, K
83
 
84
  # extract attribute/colum/feature names from notion table
85
  attributesOfInterest = DEFAULT_ATTRIBUTES
 
86
  for page in databaseFUll_pages:
87
  pv = get_property_value(page, "name")
 
 
 
88
  attributesOfInterest.append(pv)
89
  if UUID_COL not in attributesOfInterest:
90
  attributesOfInterest.append(UUID_COL)
@@ -150,7 +154,17 @@ def mainFunc(STREAM_ID, SOURCE_BRANCH, TARGET_BRANCH, UUID_COL, ATTR_METADATA, K
150
  datanew = Base()
151
  for k, v in objDict.items():
152
  if k in attributesOfInterest:
153
- datanew[k] = v
 
 
 
 
 
 
 
 
 
 
154
  else:
155
  log["avg_attrRemoved"] +=1
156
  log["removedAttr"].append(k)
 
83
 
84
  # extract attribute/colum/feature names from notion table
85
  attributesOfInterest = DEFAULT_ATTRIBUTES
86
+ attributesOfInterestDetails = {}
87
  for page in databaseFUll_pages:
88
  pv = get_property_value(page, "name")
89
+ isUsed = get_property_value(page, "isUsed")
90
+ # can be used for filtering
91
+ attributesOfInterestDetails[pv] = {"isUsed":isUsed}
92
  attributesOfInterest.append(pv)
93
  if UUID_COL not in attributesOfInterest:
94
  attributesOfInterest.append(UUID_COL)
 
154
  datanew = Base()
155
  for k, v in objDict.items():
156
  if k in attributesOfInterest:
157
+ AoIDetailsFlag = True
158
+ try:
159
+ # default to include property
160
+ isUsedFlag = attributesOfInterestDetails[k].get("isUsed", True)
161
+ if isUsedFlag == False or isUsedFlag = "False" :
162
+ AoIDetailsFlag = False
163
+ except KeyError as e: # Catching specific exceptions for clarity
164
+ print(f"AoIDetails test failed for key {k}: {e}")
165
+
166
+ if AoIDetailsFlag:
167
+ datanew[k] = v
168
  else:
169
  log["avg_attrRemoved"] +=1
170
  log["removedAttr"].append(k)