Skip to content

Commit

Permalink
Refactor SourceRef prefix assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc committed Nov 1, 2024
1 parent 69a2bd6 commit 42414fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/azul/indexer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ def spec_cls(cls) -> type[SourceSpec]:
spec_cls, ref_cls = get_generic_type_params(cls, SourceSpec, SourceRef)
return spec_cls

def with_prefix(self, prefix: Prefix) -> Self:
return attrs.evolve(self, spec=attrs.evolve(self.spec, prefix=prefix))


class SourcedBundleFQIDJSON(BundleFQIDJSON):
source: SourceJSON
Expand Down
2 changes: 1 addition & 1 deletion src/azul/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def partition_source(self,
prefix = Prefix.for_main_deployment(count)
else:
prefix = Prefix.for_lesser_deployment(count)
source = attr.evolve(source, spec=attr.evolve(source.spec, prefix=prefix))
source = source.with_prefix(prefix)
return source

@abstractmethod
Expand Down

0 comments on commit 42414fb

Please sign in to comment.