From 5735131fe83442a9807d2ed82895842ee36afa12 Mon Sep 17 00:00:00 2001 From: David Betancur Date: Wed, 11 Sep 2024 13:18:29 -0400 Subject: [PATCH] Bugfix token attribute. Bugfix missing update on headers token appending. --- .../segmentation_mask_imagesize_validation.py | 4 +++- src/ingest_validation_tests/utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ingest_validation_tests/segmentation_mask_imagesize_validation.py b/src/ingest_validation_tests/segmentation_mask_imagesize_validation.py index 5216e41..e7c85dd 100644 --- a/src/ingest_validation_tests/segmentation_mask_imagesize_validation.py +++ b/src/ingest_validation_tests/segmentation_mask_imagesize_validation.py @@ -4,6 +4,7 @@ import tifffile import xmlschema from ingest_validation_tools.plugin_validator import Validator + from ingest_validation_tests.utils import GetParentData @@ -44,6 +45,7 @@ class ImageSizeValidator(Validator): def collect_errors(self, **kwargs) -> List[Optional[str]]: del kwargs + print("Validating Image/SegMask sizes") if self.required not in self.contains and self.assay_type.lower() != self.required: return [] # We only test Segmentation Masks files_tested = None @@ -62,7 +64,7 @@ def collect_errors(self, **kwargs) -> List[Optional[str]]: for file in Path( GetParentData( - row["parent_dataset_id"], self.globus_token, self.app_context + row["parent_dataset_id"], self.token, self.app_context ).get_path() ).glob(glob_expr): parent_filenames_to_test.append(file) diff --git a/src/ingest_validation_tests/utils.py b/src/ingest_validation_tests/utils.py index 33a7472..f367f54 100644 --- a/src/ingest_validation_tests/utils.py +++ b/src/ingest_validation_tests/utils.py @@ -10,7 +10,7 @@ def __init__(self, hubmap_id, globus_token, app_context): def __get_uuid(self) -> None: url = self.app_context.get("uuid_url") + self.hubmap_id headers = self.app_context.get("request_headers", {}) - headers({"Authorization": "Bearer " + self.token}) + headers.update({"Authorization": "Bearer " + self.token}) try: response = requests.get(url, headers=headers) response.raise_for_status()