Skip to content

Commit acb173f

Browse files
committed
verify checksum before caching
1 parent 541b0f2 commit acb173f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

openml/_api/clients/http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,13 +651,13 @@ def request( # noqa: PLR0913, C901
651651
# otherwise an exception would have been raised before
652652
response = cast("Response", response)
653653

654+
if md5_checksum is not None:
655+
self._verify_checksum(response, md5_checksum)
656+
654657
if use_cache and self.cache is not None:
655658
cache_key = self.cache.get_key(url, params)
656659
self.cache.save(cache_key, response)
657660

658-
if md5_checksum is not None:
659-
self._verify_checksum(response, md5_checksum)
660-
661661
return response
662662

663663
def _verify_checksum(self, response: Response, md5_checksum: str) -> None:

0 commit comments

Comments
 (0)