Skip to content

Commit

Permalink
feat: add support for tags based on atlas terms (#466)
Browse files Browse the repository at this point in the history
* feat: add support for tags based on atlas terms

Signed-off-by: DOMINIK CHOMA <[email protected]>

* fix linting

Signed-off-by: DOMINIK CHOMA <[email protected]>

* add _get_entity_details warning log

Signed-off-by: DOMINIK CHOMA <[email protected]>

Co-authored-by: DOMINIK CHOMA <[email protected]>
  • Loading branch information
dechoma and DOMINIK CHOMA authored Mar 31, 2021
1 parent e35af58 commit cc1caf3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion databuilder/extractor/atlas_search_data_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def get_badges_from_classifications(classifications: List) -> List:
return AtlasSearchDataExtractorHelpers._filter_none(
[c.get('typeName') for c in classifications if c.get('entityStatus', '').lower() == 'active'])

@staticmethod
def get_tags_from_glossary_terms(meanings: List) -> List:
return AtlasSearchDataExtractorHelpers._filter_none(
[c.get('displayText') for c in meanings if c.get('entityStatus', '').lower() == 'active'])


class AtlasSearchDataExtractor(Extractor):
ATLAS_URL_CONFIG_KEY = 'atlas_url'
Expand Down Expand Up @@ -93,7 +98,8 @@ class AtlasSearchDataExtractor(Extractor):
lambda x: AtlasSearchDataExtractorHelpers.get_column_names(x), []),
('column_descriptions', 'relationshipAttributes.columns',
lambda x: AtlasSearchDataExtractorHelpers.get_column_descriptions(x), []),
('tags', 'tags', None, []),
('tags', 'relationshipAttributes.meanings',
lambda x: AtlasSearchDataExtractorHelpers.get_tags_from_glossary_terms(x), []),
('badges', 'classifications',
lambda x: AtlasSearchDataExtractorHelpers.get_badges_from_classifications(x), []),
('display_name', 'attributes.qualifiedName', lambda x: x.split('@')[0], None),
Expand Down Expand Up @@ -245,6 +251,8 @@ def _get_entity_details(self, guid_list: List[str]) -> List:

return result
except Exception:
LOGGER.warning(f'Error processing guids. {len(guid_list)}', exc_info=True)

return []

@staticmethod
Expand Down

0 comments on commit cc1caf3

Please sign in to comment.