cpg-utils 5.4.1__tar.gz → 5.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/PKG-INFO +1 -1
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/hail_batch.py +11 -3
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/slack.py +10 -3
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils.egg-info/PKG-INFO +1 -1
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/setup.py +1 -1
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/LICENSE +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/README.md +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/__init__.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/cloud.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/cloudpath_hail_az.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/config.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/constants.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/cromwell.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/cromwell_model.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/dataproc.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/git.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/membership.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils/py.typed +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils.egg-info/SOURCES.txt +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils.egg-info/dependency_links.txt +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils.egg-info/requires.txt +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/cpg_utils.egg-info/top_level.txt +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/pyproject.toml +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/setup.cfg +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/test/__init__.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/test/test_config.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/test/test_cromwell.py +0 -0
- {cpg_utils-5.4.1 → cpg_utils-5.4.3}/test/test_doctests.py +0 -0
|
@@ -189,12 +189,16 @@ class Batch(hb.Batch):
|
|
|
189
189
|
|
|
190
190
|
self.total_job_num += 1
|
|
191
191
|
|
|
192
|
+
# Multiple jobs in the batch might reference the same attributes dict
|
|
193
|
+
# object. Avoid modifying the dict object (e.g. with pop() or update())
|
|
194
|
+
# to avoid changing the attributes of subsequently processed jobs.
|
|
195
|
+
|
|
192
196
|
attributes = attributes or {}
|
|
193
197
|
stage = attributes.get('stage')
|
|
194
198
|
dataset = attributes.get('dataset')
|
|
195
199
|
sequencing_group = attributes.get('sequencing_group')
|
|
196
200
|
participant_id = attributes.get('participant_id')
|
|
197
|
-
sequencing_groups: set[str] = set(attributes.
|
|
201
|
+
sequencing_groups: set[str] = set(attributes.get('sequencing_groups') or [])
|
|
198
202
|
if sequencing_group:
|
|
199
203
|
sequencing_groups.add(sequencing_group)
|
|
200
204
|
part = attributes.get('part')
|
|
@@ -234,10 +238,14 @@ class Batch(hb.Batch):
|
|
|
234
238
|
self.job_by_tool[tool]['job_n'] += 1
|
|
235
239
|
self.job_by_tool[tool]['sequencing_groups'] |= sequencing_groups
|
|
236
240
|
|
|
241
|
+
# Ensure all the returned attribute values are presented as strings
|
|
242
|
+
fixed_attrs = {
|
|
243
|
+
k: str(v) for k, v in attributes.items() if k != 'sequencing_groups'
|
|
244
|
+
}
|
|
245
|
+
|
|
237
246
|
seqgroups_str = str(sorted(sequencing_groups))
|
|
238
|
-
|
|
247
|
+
fixed_attrs.update(self._pack_attribute('sequencing_groups', seqgroups_str))
|
|
239
248
|
|
|
240
|
-
fixed_attrs = {k: str(v) for k, v in attributes.items()}
|
|
241
249
|
return name, fixed_attrs
|
|
242
250
|
|
|
243
251
|
def run(self, **kwargs: Any):
|
|
@@ -66,14 +66,21 @@ def send_message(text: str) -> None:
|
|
|
66
66
|
logging.error(f'Error posting to Slack: {err}')
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
def upload_file(
|
|
69
|
+
def upload_file(
|
|
70
|
+
content: bytes,
|
|
71
|
+
comment: str,
|
|
72
|
+
title: str | None = None,
|
|
73
|
+
filename: str | None = None,
|
|
74
|
+
) -> None:
|
|
70
75
|
"""Uploads `content` to Slack with the given text `comment`, reading credentials from the config."""
|
|
71
76
|
slack_client = _get_slack_sdk().WebClient(token=_get_token())
|
|
72
77
|
try:
|
|
73
|
-
slack_client.
|
|
74
|
-
|
|
78
|
+
slack_client.files_upload_v2(
|
|
79
|
+
channel=_get_channel(),
|
|
75
80
|
content=content,
|
|
76
81
|
initial_comment=comment,
|
|
82
|
+
title=title,
|
|
83
|
+
filename=filename,
|
|
77
84
|
)
|
|
78
85
|
except _get_slack_sdk().errors.SlackApiError as err:
|
|
79
86
|
logging.error(f'Error posting to Slack: {err}')
|
|
@@ -8,7 +8,7 @@ with open('README.md') as f:
|
|
|
8
8
|
setup(
|
|
9
9
|
name='cpg-utils',
|
|
10
10
|
# This tag is automatically updated by bumpversion
|
|
11
|
-
version='5.4.
|
|
11
|
+
version='5.4.3',
|
|
12
12
|
description='Library of convenience functions specific to the CPG',
|
|
13
13
|
long_description=long_description,
|
|
14
14
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|