What happened?
amber/src/main/python/pytexera/storage/dataset_file_document.py::DatasetFileDocument.get_presigned_url does response.json().get("presignedUrl"), so a 200 response that omits the presignedUrl field silently returns None instead of raising. read_file then calls requests.get(None) and the caller gets a less-actionable error than the explicit-status path.
How to reproduce?
import os
from unittest.mock import patch, MagicMock
from pytexera.storage.dataset_file_document import DatasetFileDocument
os.environ["USER_JWT_TOKEN"] = "t"
os.environ["FILE_SERVICE_GET_PRESIGNED_URL_ENDPOINT"] = "http://x"
doc = DatasetFileDocument("/o/d/v/f.csv")
with patch("pytexera.storage.dataset_file_document.requests.get") as g:
g.return_value = MagicMock(status_code=200, **{"json.return_value": {}, "text": "{}"})
print(doc.get_presigned_url()) # prints None instead of raising
Version
1.1.0-incubating (Pre-release/Master)
What happened?
amber/src/main/python/pytexera/storage/dataset_file_document.py::DatasetFileDocument.get_presigned_urldoesresponse.json().get("presignedUrl"), so a 200 response that omits thepresignedUrlfield silently returnsNoneinstead of raising.read_filethen callsrequests.get(None)and the caller gets a less-actionable error than the explicit-status path.How to reproduce?
Version
1.1.0-incubating (Pre-release/Master)