From 6b2a9c85673ddfe218e92501eee4b3770ee89f93 Mon Sep 17 00:00:00 2001 From: verdan Date: Tue, 18 Aug 2020 01:32:23 +0200 Subject: [PATCH] Updates the lambda function definition --- metadata_service/proxy/atlas_proxy.py | 5 ++--- tests/unit/proxy/test_atlas_proxy.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/metadata_service/proxy/atlas_proxy.py b/metadata_service/proxy/atlas_proxy.py index 112ffc9b..f0b65b57 100644 --- a/metadata_service/proxy/atlas_proxy.py +++ b/metadata_service/proxy/atlas_proxy.py @@ -58,8 +58,7 @@ class AtlasProxy(BaseProxy): ATTRS_KEY = 'attributes' REL_ATTRS_KEY = 'relationshipAttributes' ENTITY_URI_KEY = 'entityUri' - # Variables 'x' in lambda function represents the 'self'. - user_detail_method = app.config.get('USER_DETAIL_METHOD') or (lambda x, y: None) + user_detail_method = app.config.get('USER_DETAIL_METHOD') or (lambda *args: None) _CACHE = CacheManager(**parse_cache_config_options({'cache.regions': 'atlas_proxy', 'cache.atlas_proxy.type': 'memory', 'cache.atlas_proxy.expire': _ATLAS_PROXY_CACHE_EXPIRY_SEC})) @@ -378,7 +377,7 @@ def _get_reports(self, guids: List[str]) -> List[ResourceReport]: return parsed_reports - def _get_owners(self, data_owner, fallback_owner): + def _get_owners(self, data_owner: list, fallback_owner: str) -> List[User]: data_owners = list() active_owners = filter(lambda item: item['entityStatus'] == Status.ACTIVE and diff --git a/tests/unit/proxy/test_atlas_proxy.py b/tests/unit/proxy/test_atlas_proxy.py index af7d4150..c939f1be 100644 --- a/tests/unit/proxy/test_atlas_proxy.py +++ b/tests/unit/proxy/test_atlas_proxy.py @@ -112,7 +112,7 @@ def _get_table(self, custom_stats_format: bool = False) -> None: ent_attrs = cast(dict, self.entity1['attributes']) self._mock_get_table_entity() self._create_mocked_report_entities_collection() - self.proxy._get_owners = MagicMock(return_value=[User(email=ent_attrs['owner'])]) + self.proxy._get_owners = MagicMock(return_value=[User(email=ent_attrs['owner'])]) # type: ignore self.proxy._driver.entity_bulk = MagicMock(return_value=self.report_entity_collection) response = self.proxy.get_table(table_uri=self.table_uri)