Skip to content

Commit

Permalink
Replace assert with exception
Browse files Browse the repository at this point in the history
  • Loading branch information
przadka committed Jun 20, 2023
1 parent a56bd07 commit 3965e2c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions b2sdk/transfer/emerge/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,9 @@ def _find_unfinished_file_by_plan_id(
:param cache_control: The cache control settings for the file, if any.
:return: A tuple of the best matching unfinished file and its finished parts. If no match is found, it returns `None`.
Note: This operation requires the application key to have 'listFiles' access.
"""
assert 'plan_id' in file_info
if 'plan_id' not in file_info:
raise ValueError("The 'plan_id' key must be in file_info dictionary.")

return self._find_matching_unfinished_file(
bucket_id=bucket_id,
Expand Down Expand Up @@ -551,8 +550,6 @@ def _match_unfinished_file_if_possible(
:param cache_control: The cache control settings for the file, if set.
:return: A tuple of the best matching unfinished file and its finished parts. If no match is found, returns `None`.
Note: This operation requires the application key to have 'listFiles' access.
"""
logger.debug('Checking for matching unfinished large files for %s...', file_name)

Expand Down

0 comments on commit 3965e2c

Please sign in to comment.