Skip to content

Commit

Permalink
Updates the lambda function definition
Browse files Browse the repository at this point in the history
  • Loading branch information
verdan committed Aug 17, 2020
1 parent 6e28285 commit 6b2a9c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions metadata_service/proxy/atlas_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/proxy/test_atlas_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6b2a9c8

Please sign in to comment.