@@ -307,28 +307,23 @@ def paginate_entity_api_results(self, entity_type, page_size=100):
307
307
total_items = page_size
308
308
309
309
while current_page * page_size < total_items :
310
- try :
311
- response = self .session .get (
312
- f"{ self .config .connect_uri } /api/v1/{ entity_type } " ,
313
- params = {"q" : f"(page:{ current_page } ,page_size:{ page_size } )" },
314
- timeout = 10 ,
315
- )
310
+ response = self .session .get (
311
+ f"{ self .config .connect_uri } /api/v1/{ entity_type } " ,
312
+ params = {"q" : f"(page:{ current_page } ,page_size:{ page_size } )" },
313
+ timeout = 10 ,
314
+ )
316
315
317
- if response .status_code != 200 :
318
- logger .warning (f"Failed to get { entity_type } data: { response .text } " )
316
+ if response .status_code != 200 :
317
+ logger .warning (f"Failed to get { entity_type } data: { response .text } " )
319
318
320
- payload = response .json ()
321
- # Update total_items with the actual count from the response
322
- total_items = payload .get ("count" , total_items )
323
- # Yield each item in the result, this gets passed into the construct functions
324
- for item in payload .get ("result" , []):
325
- yield item
319
+ payload = response .json ()
320
+ # Update total_items with the actual count from the response
321
+ total_items = payload .get ("count" , total_items )
322
+ # Yield each item in the result, this gets passed into the construct functions
323
+ for item in payload .get ("result" , []):
324
+ yield item
326
325
327
- current_page += 1
328
- except requests .exceptions .Timeout :
329
- logger .info (
330
- f"Request timed out while fetching { entity_type } data (page { current_page } )."
331
- )
326
+ current_page += 1
332
327
333
328
def parse_owner_info (self ) -> Dict [str , Any ]:
334
329
entity_types = ["dataset" , "dashboard" , "chart" ]
@@ -351,20 +346,15 @@ def build_owner_urn(self, data: Dict[str, Any]) -> List[str]:
351
346
352
347
@lru_cache (maxsize = None )
353
348
def get_dataset_info (self , dataset_id : int ) -> dict :
354
- try :
355
- dataset_response = self .session .get (
356
- f"{ self .config .connect_uri } /api/v1/dataset/{ dataset_id } " ,
357
- timeout = 10 ,
358
- )
359
- if dataset_response .status_code != 200 :
360
- logger .warning (f"Failed to get dataset info: { dataset_response .text } " )
361
- dataset_response .raise_for_status ()
362
- return dataset_response .json ()
363
- except requests .exceptions .Timeout :
364
- logger .info (
365
- f"Request timed out while fetching dataset info for { dataset_id } ."
366
- )
367
- return {}
349
+ dataset_response = self .session .get (
350
+ f"{ self .config .connect_uri } /api/v1/dataset/{ dataset_id } " ,
351
+ timeout = 10 ,
352
+ )
353
+ if dataset_response .status_code != 200 :
354
+ logger .warning (f"Failed to get dataset info: { dataset_response .text } " )
355
+ dataset_response .raise_for_status ()
356
+ return {}
357
+ return dataset_response .json ()
368
358
369
359
def get_datasource_urn_from_id (
370
360
self , dataset_response : dict , platform_instance : str
0 commit comments