Closed R1k91 closed 6 months ago
the function is not exposed yet but there're bugs in it:
I think the right code is: ` def list_warehouses(workspace = None):
""" Documentation is available here: https://github.com/m-kovalsky/fabric_cat_tools?tab=readme-ov-file#list_warehouses """ df = pd.DataFrame(columns=['Warehouse Name', 'Warehouse ID', 'Description', 'Connection Info', 'Created Date', 'Last Updated Time']) if workspace == None: workspace_id = fabric.get_workspace_id() workspace = fabric.resolve_workspace_name(workspace_id) else: workspace_id = fabric.resolve_workspace_id(workspace) client = fabric.FabricRestClient() response = client.get(f"/v1/workspaces/{workspace_id}/warehouses/") for v in response.json()['value']: warehouse_id = v['id'] warehouse_name = v['displayName'] desc = v['description'] prop = v['properties'] connInfo = prop['connectionInfo'] createdDate = prop['createdDate'] lastUpdate = prop['lastUpdatedTime'] new_data = {'Warehouse Name': warehouse_name, 'Warehouse ID': warehouse_id, 'Description': desc, 'Connection Info': connInfo, 'Created Date': createdDate, 'Last Updated Time': lastUpdate} df = pd.concat([df, pd.DataFrame(new_data, index=[0])], ignore_index=True) return df
`
Ah, my mistake. This fix will go out in the next release. Thanks for reporting.
This is resolved in 0.4.0
the function is not exposed yet but there're bugs in it:
I think the right code is: ` def list_warehouses(workspace = None):
`