Skip to content

Commit

Permalink
added in customization in merge order in the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
jal347 committed Aug 4, 2023
1 parent 19a8587 commit d864b09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion biothings/hub/databuild/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,10 @@ def get_mapper_for_source(self, src_name, init=True):
except KeyError:
raise BuilderException("Found mapper named '%s' but no mapper associated" % mapper_name)

def merge_order(self, other_sources):
# Optional method to specify the order in which sources should be merged
return sorted(other_sources)

async def merge_sources(self, source_names, steps=("merge", "post"), batch_size=100000, ids=None, job_manager=None):
"""
Merge resources from given source_names or from build config.
Expand Down Expand Up @@ -710,7 +714,7 @@ async def merge_sources(self, source_names, steps=("merge", "post"), batch_size=

source_names = sorted(source_names)
root_sources = sorted(root_sources)
other_sources = sorted(other_sources)
other_sources = self.merge_order(other_sources)

self.logger.info("Sources to be merged: %s", source_names)
self.logger.info("Root sources: %s", root_sources)
Expand Down

0 comments on commit d864b09

Please sign in to comment.