Skip to content

Commit

Permalink
Fix line wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc committed Jun 30, 2023
1 parent 3518091 commit 9971402
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/azul/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,11 @@ def integration_test_catalogs(self) -> Mapping[CatalogName, Catalog]:
if catalog.is_integration_test_catalog
}

def es_index_name(self, catalog: CatalogName, entity_type: str, aggregate: bool) -> str:
def es_index_name(self,
catalog: CatalogName,
entity_type: str,
aggregate: bool
) -> str:
return str(IndexName(prefix=self._index_prefix,
version=2,
deployment=self.deployment_stage,
Expand Down
15 changes: 11 additions & 4 deletions src/azul/indexer/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def _from_index(cls,
) -> 'DocumentCoordinates[CataloguedEntityReference]':
raise NotImplementedError

def with_catalog(self, catalog: Optional[CatalogName]) -> 'DocumentCoordinates[CataloguedEntityReference]':
def with_catalog(self,
catalog: Optional[CatalogName]
) -> 'DocumentCoordinates[CataloguedEntityReference]':
"""
Return coordinates for the given catalog. Only works for instances that
have no catalog or ones having the same catalog in which case `self` is
Expand Down Expand Up @@ -187,8 +189,10 @@ def document_id(self) -> str:
))

@classmethod
def _from_index(cls, index_name: IndexName,
document_id: str) -> 'ContributionCoordinates[CataloguedEntityReference]':
def _from_index(cls,
index_name: IndexName,
document_id: str
) -> 'ContributionCoordinates[CataloguedEntityReference]':
entity_type = index_name.entity_type
assert index_name.aggregate is False
entity_id, bundle_uuid, bundle_version, deleted = document_id.split('_')
Expand Down Expand Up @@ -222,7 +226,10 @@ class AggregateCoordinates(DocumentCoordinates[CataloguedEntityReference]):
aggregate: bool = attr.ib(init=False, default=True)

@classmethod
def _from_index(cls, index_name: IndexName, document_id: str) -> 'AggregateCoordinates':
def _from_index(cls,
index_name: IndexName,
document_id: str
) -> 'AggregateCoordinates':
entity_type = index_name.entity_type
assert index_name.aggregate is True
return cls(entity=CataloguedEntityReference(catalog=index_name.catalog,
Expand Down

0 comments on commit 9971402

Please sign in to comment.