Skip to content

Commit

Permalink
Refactored PortalBase from structured_data into portal_utils.Portal
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Dec 10, 2023
1 parent 9ce5ba4 commit a7ed50b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dcicutils/structured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def __init__(self,
key: Optional[Union[dict, tuple]] = None,
portal: Optional[Union[VirtualApp, TestApp, Router, Portal, str]] = None,
data: Optional[dict] = None, schemas: Optional[List[dict]] = None) -> Optional[Portal]:
super(Portal, self).__init__(arg, env=env, app=app, server=server, key=key, portal=portal)
super().__init__(arg, env=env, app=app, server=server, key=key, portal=portal)
if isinstance(arg, Portal) and not portal:
portal = arg
if isinstance(portal, Portal):
Expand All @@ -554,7 +554,7 @@ def __init__(self,
@lru_cache(maxsize=256)
def get_metadata(self, object_name: str) -> Optional[dict]:
try:
return super(Portal, self).get_metadata(object_name)
return super().get_metadata(object_name)
except Exception:
return None

Expand All @@ -569,7 +569,7 @@ def get_schema(self, schema_name: str) -> Optional[dict]:

@lru_cache(maxsize=1)
def get_schemas(self) -> dict:
schemas = super(Portal, self).get_schemas()
schemas = super().get_schemas()
if self._schemas:
schemas = copy.deepcopy(schemas)
for user_specified_schema in self._schemas:
Expand All @@ -579,7 +579,7 @@ def get_schemas(self) -> dict:

@lru_cache(maxsize=1)
def get_schemas_super_type_map(self) -> dict:
return super(Portal, self).get_schemas_super_type_map()
return super().get_schemas_super_type_map()

def ref_exists(self, type_name: str, value: str) -> List[str]:
resolved = []
Expand Down

0 comments on commit a7ed50b

Please sign in to comment.