Skip to content

Commit

Permalink
Merge pull request #85 from HumanCellAtlas/cw-fix-bug-on-labels
Browse files Browse the repository at this point in the history
Fix a bug in lira_utils
  • Loading branch information
rexwangcc authored Jun 14, 2018
2 parents cc17405 + 86123c6 commit e1bfc5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lira/lira_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def legalize_cromwell_labels(label):
length limitation of 255. This function will subset the first 255 characters for too long string values.
Args:
label (str | list): A string or a list of a string of key/value of labels need to be legalized.
label (str | list | None): A string or a list of a string of key/value of labels need to be legalized.
Returns:
str: A string of label with no more than 255 characters.
Expand All @@ -259,7 +259,7 @@ def legalize_cromwell_labels(label):
if len(label) != 1:
raise ValueError('{} should contain exactly one element!'.format(label))
label = label[0]
return label[:cromwell_label_maximum_length]
return str(label)[:cromwell_label_maximum_length]


def compose_labels(workflow_name, workflow_version, bundle_uuid, bundle_version, *extra_labels):
Expand Down
2 changes: 1 addition & 1 deletion lira/test/notification.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"transaction_id": "9d0eb75c-d950-4e62-b685-4f20c8569410",
"subscription_id": "222",
"attachments": {
"submitter_id": "None",
"submitter_id": null,
"sample_id": [
"b1829a9d-6678-493b-bf98-01520f9bad52"
],
Expand Down
2 changes: 1 addition & 1 deletion lira/test/test_lira_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def setUpClass(cls):
cls.list_label = {'list_label': ['test']}
cls.invalid_list_label = {'list_label': ['test', 'test2']}
cls.attachments = {
'submitter_id': 'None',
'submitter_id': None,
'sample_id': [
'b1829a9d-6678-493b-bf98-01520f9bad52'
],
Expand Down

0 comments on commit e1bfc5f

Please sign in to comment.