@@ -167,6 +167,7 @@ def get_value(values: dict[str, Any], path: list[str]) -> Any:
167167 except KeyError :
168168 return None
169169
170+ attribute_path = None
170171 for attribute in self ._iterate_attributes (structure ):
171172 try :
172173 attribute_path = "/" .join (attribute ._path )
@@ -193,7 +194,7 @@ def get_value(values: dict[str, Any], path: list[str]) -> Any:
193194 }
194195 )
195196 except Exception as e :
196- self ._handle_run_exception (run_id , e )
197+ self ._handle_attribute_exception (run_id , attribute_path , e )
197198
198199 if all_data :
199200 converted_df = self ._convert_parameters_to_schema (all_data , project_id )
@@ -291,6 +292,7 @@ def _process_run_metrics(
291292 ) as run :
292293 structure = run .get_structure ()
293294
295+ attribute_path = None
294296 for attribute in self ._iterate_attributes (structure ):
295297 try :
296298 attribute_path = "/" .join (attribute ._path )
@@ -314,7 +316,7 @@ def _process_run_metrics(
314316
315317 all_data_dfs .append (series_df )
316318 except Exception as e :
317- self ._handle_run_exception (run_id , e )
319+ self ._handle_attribute_exception (run_id , attribute_path , e )
318320
319321 if all_data_dfs :
320322 converted_df = self ._convert_metrics_to_schema (all_data_dfs , project_id )
@@ -393,6 +395,7 @@ def _process_run_series(
393395 ) as run :
394396 structure = run .get_structure ()
395397
398+ attribute_path = None
396399 for attribute in self ._iterate_attributes (structure ):
397400 try :
398401 attribute_path = "/" .join (attribute ._path )
@@ -416,7 +419,7 @@ def _process_run_series(
416419
417420 all_data_dfs .append (series_df )
418421 except Exception as e :
419- self ._handle_run_exception (run_id , e )
422+ self ._handle_attribute_exception (run_id , attribute_path , e )
420423
421424 if all_data_dfs :
422425 converted_df = self ._convert_series_to_schema (all_data_dfs , project_id )
@@ -500,6 +503,7 @@ def _process_run_files(
500503 ) as run :
501504 structure = run .get_structure ()
502505
506+ attribute_path = None
503507 for attribute in self ._iterate_attributes (structure ):
504508 try :
505509 attribute_path = "/" .join (attribute ._path )
@@ -614,7 +618,7 @@ def _process_run_files(
614618 }
615619 )
616620 except Exception as e :
617- self ._handle_run_exception (run_id , e )
621+ self ._handle_attribute_exception (run_id , attribute_path , e )
618622
619623 if all_data_dfs :
620624 converted_df = self ._convert_files_to_schema (all_data_dfs , project_id )
@@ -712,3 +716,35 @@ def _handle_run_exception(self, run_id: SourceRunId, exception: Exception) -> No
712716 self ._logger .error (
713717 f"Unexpected error processing run { run_id } : { exception } " , exc_info = True
714718 )
719+
720+ def _handle_attribute_exception (
721+ self , run_id : SourceRunId , attribute_path : Optional [str ], exception : Exception
722+ ) -> None :
723+ """Handle exceptions that occur during attribute processing."""
724+ if attribute_path is None :
725+ self ._handle_run_exception (run_id , exception )
726+ return
727+
728+ if isinstance (exception , neptune .exceptions .NeptuneConnectionLostException ):
729+ # Network issues - might be temporary, user should retry
730+ self ._logger .warning (
731+ f"Connection lost processing run { run_id } attribute { attribute_path } : { exception } "
732+ )
733+ elif isinstance (exception , neptune .exceptions .NeptuneApiException ):
734+ # API errors - could be rate limiting, auth issues, etc.
735+ self ._logger .warning (
736+ f"API error processing run { run_id } attribute { attribute_path } : { exception } "
737+ )
738+ elif isinstance (exception , neptune .exceptions .NeptuneException ):
739+ if attribute_path == "sys/group_tags" :
740+ self ._logger .debug (
741+ f"Neptune error processing run { run_id } attribute { attribute_path } : { exception } " ,
742+ exc_info = True ,
743+ )
744+ else :
745+ # Other Neptune-specific errors
746+ self ._logger .error (
747+ f"Neptune error processing run { run_id } attribute { attribute_path } : { exception } "
748+ )
749+ else :
750+ self ._handle_run_exception (run_id , exception )
0 commit comments