fix: mac addresses duplicated due to same interface object being re-ingested #203
      
        
          +44
        
        
          −6
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This pull request refactors how parent interfaces are represented and resolved in the translation logic for device discovery, focusing on simplifying parent-child relationships by storing and passing parent interface names instead of full interface objects. It also introduces a new test to ensure subinterfaces derived only from IP data correctly link to their parent interfaces.
Refactoring parent interface representation
parentparameter intranslate_interfaceand related docstrings to usestr | None(interface name) instead ofInterface | None(full object), streamlining how parent relationships are handled. [1] [2]assigned_object_interfacein IP entity creation to use the interface name rather than the interface object.resolve_parentfunction to return the parent interface name (str | None) instead of the full interface object, and adjusted the logic to check both defined and entity names for parent existence.Testing parent-child relationships
test_translate_data_creates_ip_only_subinterface_parent_relationship, which verifies that subinterfaces created solely from IP data correctly reference their parent interface by name.