Skip to content

Commit

Permalink
fix exportJointly option (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewNepogoda authored Oct 10, 2023
1 parent 93d8d5a commit 3424c52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli-e2e-test/config/model/scenario1.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
{
"type": "Export",
"name": "Export",
"exportJointly": false,
"exportJointly": true,
"dateFormat": "%Y%m%d",
"defaultContainer": "export",
"exports": [
Expand Down
5 changes: 3 additions & 2 deletions workflow/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ def execute(self, logger: logging.Logger, env_config: EnvConfig, rai_config: Rai
exports = list(filter(lambda e: self._should_export(logger, rai_config, e), self.exports))
if self.export_jointly:
exports.sort(key=lambda e: e.container.name)
container_groups = {container: list(group) for container, group in
container_groups = {container_name: list(group) for container_name, group in
groupby(exports, key=lambda e: e.container.name)}
for container, grouped_exports in container_groups.items():
for container_name, grouped_exports in container_groups.items():
container = env_config.get_container(container_name)
ExportWorkflowStep.get_export_function(container)(logger, rai_config, grouped_exports, self.end_date,
self.date_format, container)
else:
Expand Down

0 comments on commit 3424c52

Please sign in to comment.