Skip to content

Commit

Permalink
Merge pull request #116 from mvdbeek/fix_get_size
Browse files Browse the repository at this point in the history
Fix get_dataset_size for datasets with null file_size column
  • Loading branch information
nuwang authored Nov 22, 2023
2 parents 64830ed + 9ebb84d commit 9218266
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tpv/commands/test/mock_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def __init__(self, file_name, file_size):
self.file_name = file_name
self.file_size = file_size

def get_size(self, calculate_size=False):
return self.file_size


# Tool mock and helpers=========================================
class Tool:
Expand Down
4 changes: 3 additions & 1 deletion tpv/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@


def get_dataset_size(dataset):
return float(dataset.file_size)
# calculate_size would mark file_size column as dirty
# and may have unintended consequences
return float(dataset.get_size(calculate_size=False))


def sum_total(prev, current):
Expand Down

0 comments on commit 9218266

Please sign in to comment.