Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce hash checks #172

Merged
merged 4 commits into from
Jan 20, 2025
Merged

Enforce hash checks #172

merged 4 commits into from
Jan 20, 2025

Conversation

bputzeys
Copy link
Collaborator

No description provided.

Copy link

@giogix2
Copy link
Contributor

giogix2 commented Jan 17, 2025

Have you tested this? Even locally with a few files? I'm asking because the logic where we retrieve the last part of the file might be prone to errors.

@bputzeys
Copy link
Collaborator Author

Yes I tested locally with local files, also very small ones and get same results.

@@ -188,7 +202,7 @@ def download_via_name(self, name: str) -> None:
os.makedirs(os.path.dirname(output),exist_ok=True)
LOGGER.info(f"Creating Folder {os.path.dirname(output)}")

if Path(output).is_file() and self.calculate_partial_file_hash(output) == HASH_DICT.get(name):
if Path(output).is_file() and self.calculate_partial_file_hash(output) == HASH_DICT[name]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is intentional. when a new file is meant to be downloaded but not yet in the hash_dict, you get a key_error, indicating you should update the dict with the new hash

@bputzeys bputzeys merged commit 5dd83e3 into main Jan 20, 2025
5 checks passed
@bputzeys bputzeys deleted the enforce-hash-checks branch January 20, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants