OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

OpenMetadata SDK: Remove Operation on patch_tags and patch_column_tags function

Open nqvuong1998 opened this issue 1 year ago • 0 comments

Affected module It impacts the OpenMetadata SDK

Describe the bug https://github.com/open-metadata/OpenMetadata/blob/1.3.3-release/ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py#L72-L74 https://github.com/open-metadata/OpenMetadata/blob/1.3.3-release/ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py#L295-L297

  • When the loop iterates over the list, it starts at index 0 and prints the element at that position.
  • Then, it removes the current element from the list using l.remove(i).
  • This removal shifts all remaining elements one position to the left and shrinks the list.
  • The loop then proceeds to the next iteration, but since the list has been modified (shortened), the next element after the current one might be skipped because of the index shift.

To Reproduce Iterate over a copy of the list and remove elements from the original list:

  • for tag in col.tags[:]:
  • for tag in destination.tags[:]:

Version:

  • OpenMetadata version: 1.3.1
  • OpenMetadata Ingestion package version: openmetadata-ingestion==1.3.1.3

nqvuong1998 avatar Apr 19 '24 08:04 nqvuong1998