berryworld 1.0.0.189012__py3-none-any.whl → 1.0.0.189396__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.
@@ -158,11 +158,16 @@ class PowerAutomate:
158
158
  f'owners?{self.api_version}'
159
159
 
160
160
  flow_owners_response = self.session_request("GET", flow_url).to_dict(orient='records')
161
- flow_user_ids = [owner['name'] for owner in flow_owners_response if
162
- owner['properties']['principal']['type'] == 'User']
161
+ flow_user_ids = []
162
+ flow_group_ids = []
163
163
 
164
- flow_group_ids = [owner['name'] for owner in flow_owners_response if
165
- owner['properties']['principal']['type'] == 'Group']
164
+ for owner in flow_owners_response:
165
+ if 'principal' in owner['properties']:
166
+ principal_type = owner['properties']['principal'].get('type', None)
167
+ if principal_type == 'User':
168
+ flow_user_ids.append(owner['name'])
169
+ elif principal_type == 'Group':
170
+ flow_group_ids.append(owner['name'])
166
171
 
167
172
  return flow_user_ids, flow_group_ids
168
173
 
@@ -219,7 +224,8 @@ class PowerAutomate:
219
224
  accounts_df = pd.concat([accounts_df, self.list_graph_accounts('groups', batch_group_ids)])
220
225
 
221
226
  # Get Creator
222
- flows_df['CreatedById'] = flows_df['FlowProperties'].apply(lambda x: x['creator']['userId'])
227
+ flows_df['CreatedById'] = flows_df['FlowProperties'].apply(
228
+ lambda x: x['creator']['userId'] if 'creator' in x else None)
223
229
  flows_df = flows_df.merge(
224
230
  accounts_df[['displayName', 'id']].rename(columns={'id': 'CreatedById'}).drop_duplicates(),
225
231
  how='left', on='CreatedById')
@@ -467,12 +473,14 @@ class PowerAutomate:
467
473
  )
468
474
 
469
475
  if relevant_columns & enrich:
470
- flows_final_df = flows_df[['FlowId', 'FlowName', 'id', 'FlowUrl', 'JsonDefinition', 'State', 'CreatedBy',
471
- 'Owners', 'CreatedDate', 'LastModifiedDate', 'FlowSuspensionReason',
472
- 'ErrorCount', 'ErrorMessage', 'RunCount', 'RunProperties', 'LastRun',
473
- 'LastRunStatus', 'ConnectionAccountName', 'ConnectionStatus',
474
- 'ConnectionLastModifiedTime', 'ConnectionsCount',
475
- 'ConnectionAuthenticatedUserName']]
476
+ required_columns = ['FlowId', 'FlowName', 'id', 'FlowUrl', 'JsonDefinition', 'State', 'CreatedBy',
477
+ 'Owners', 'CreatedDate', 'LastModifiedDate', 'FlowSuspensionReason',
478
+ 'ErrorCount', 'ErrorMessage', 'RunCount', 'RunProperties', 'LastRun',
479
+ 'LastRunStatus', 'ConnectionAccountName', 'ConnectionStatus',
480
+ 'ConnectionLastModifiedTime', 'ConnectionsCount', 'ConnectionAuthenticatedUserName']
481
+
482
+ existing_columns = [col for col in required_columns if col in flows_df.columns]
483
+ flows_final_df = flows_df[existing_columns]
476
484
 
477
485
  if 'FlowSuspensionReasonDetails' in flows_df.columns:
478
486
  flows_final_df = flows_final_df.assign(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: berryworld
3
- Version: 1.0.0.189012
3
+ Version: 1.0.0.189396
4
4
  Summary: Handy classes to improve ETL processes
5
5
  Home-page: https://www.berryworld.com
6
6
  Author: BerryWorld ltd
@@ -15,7 +15,7 @@ berryworld/logic_apps.py,sha256=a0uU4tNO3v2w7grdBv-OOx4hUf7VBIerJpwZ9U-29dQ,1459
15
15
  berryworld/microsoft_teams.py,sha256=8uPo0yku-euBj2VdzBoZCeX3IcsCCOqISLqaVZUVxfA,16030
16
16
  berryworld/persistent_storage.py,sha256=KQA57ez8eVTUCtudYkHPg_S5lcOEa_E7xXcaN1DYMMc,8601
17
17
  berryworld/pickle_management.py,sha256=5o6UuXBpTj23Jgpz6sj9V-vdcdWBK1xMEckWxT-Whj4,2436
18
- berryworld/power_automate.py,sha256=Y11GoeDEwd3Y2RdvtPPhBSFK65APEceAQKtNo4gVLK4,26464
18
+ berryworld/power_automate.py,sha256=IWLXdc4-HPM0Eq9VwlaXcr17vQKh6LOmtqo-CztUzJY,26713
19
19
  berryworld/sharepoint_con.py,sha256=TuH-Vxk1VxjTi7x80KFssf_J8YPLRXpV27RBaFZi37U,22254
20
20
  berryworld/snowflake_conn.py,sha256=go5ZJjnhz5SkG83B0G0XZSwKgU6tg7AFTBso59oRG5M,2434
21
21
  berryworld/sql_conn.py,sha256=r2rAVRc3Mes0m6_62J4uFg5GLBNMr7Vkme9Ip6jT3aA,47283
@@ -25,12 +25,12 @@ berryworld/verify_keys.py,sha256=X4Nuz3o0XbRDYofbJGvxIDeN5gfWj19PN7lhO6T3hR8,435
25
25
  berryworld/vivantio.py,sha256=QfZo0UKqkzVRg_LyiwivNd3aEup4TH57x4KxLZkCJwc,10627
26
26
  berryworld/vivantio_logging.py,sha256=ciy7gA4u3FrgUIpEBnMgocbNPp6jcu9TPoy-kLcrTZU,5736
27
27
  berryworld/xml_parser.py,sha256=HWD71NaTN3DaIOGT6Wzxs4CEsroFhGQwe9iPLIL80Co,957
28
- berryworld-1.0.0.189012.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
28
+ berryworld-1.0.0.189396.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
29
29
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  tests/test_allocation_config.py,sha256=e12l6fE9U57eSPS35g6ekJ_hol7-RHg89JV60_m1BlE,4633
31
31
  tests/test_handy_mix_config.py,sha256=Un56mz9KJmdn4K4OwzHAHLSRzDU1Xv2nFrONNuzOG04,2594
32
32
  tests/test_xml_parser.py,sha256=3QTlhFEd6KbK6nRFKZnc35tad6wqukTbe4QrFi8mr_8,859
33
- berryworld-1.0.0.189012.dist-info/METADATA,sha256=G_C7noVeA6eQTLZN_aevjCibBaGJ0dj3dk6mawRqrlY,1362
34
- berryworld-1.0.0.189012.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
35
- berryworld-1.0.0.189012.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
36
- berryworld-1.0.0.189012.dist-info/RECORD,,
33
+ berryworld-1.0.0.189396.dist-info/METADATA,sha256=T8GbmSXFhWFhwvXBzh9W7XhduBes63nHmH_p5Bi4ZkI,1362
34
+ berryworld-1.0.0.189396.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
35
+ berryworld-1.0.0.189396.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
36
+ berryworld-1.0.0.189396.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5