VictorPlusC commented on a change in pull request #17044:
URL: https://github.com/apache/beam/pull/17044#discussion_r826400629
##########
File path: sdks/python/apache_beam/runners/interactive/cache_manager.py
##########
@@ -190,7 +190,14 @@ def __init__(self, cache_dir=None, cache_format='text'):
def size(self, *labels):
if self.exists(*labels):
- return sum(os.path.getsize(path) for path in self._match(*labels))
+ matched_path = self._match(*labels)
+ # if any matched path has a gs:// prefix, it must be cached on GCS
+ if 'gs://' in matched_path[0]:
Review comment:
It seems that `matched_path` is guaranteed to be non-empty here because
we only follow this execution path if `self.exists(*labels)` evaluates to True.
The exists method calls `self._match(*labels)` and returns True if the matches
are non-empty as shown here:
https://github.com/apache/beam/blob/master/sdks/python/apache_beam/runners/interactive/cache_manager.py#L196
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]