From a19b6b64d9ac80529161ef6762cd99270bc52420 Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Mon, 4 Nov 2024 11:35:10 +0100 Subject: [PATCH 1/2] Fix filehandling option. --- src/scicat_offline_ingestor.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/scicat_offline_ingestor.py b/src/scicat_offline_ingestor.py index abc2095..d7d88b0 100755 --- a/src/scicat_offline_ingestor.py +++ b/src/scicat_offline_ingestor.py @@ -145,17 +145,11 @@ def main() -> None: metadata_schema.variables, h5file, config ) - # Collect data-file descriptions - if not config.ingestion.file_handling.use_full_file_path: - source_folder = variable_map["source_folder"] - else: - source_folder = None - data_file_list = create_data_file_list( nexus_file=nexus_file_path, ingestor_directory=ingestor_directory, config=fh_options, - source_folder=source_folder, + source_folder=variable_map["source_folder"], logger=logger, # TODO: add done_writing_message_file and nexus_structure_file ) From d6fdd849e2d71bd2440bc30ee0ac93360becb7ae Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Mon, 4 Nov 2024 11:42:24 +0100 Subject: [PATCH 2/2] Fix header call. --- src/scicat_communication.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scicat_communication.py b/src/scicat_communication.py index 12b1681..fab1783 100644 --- a/src/scicat_communication.py +++ b/src/scicat_communication.py @@ -18,7 +18,7 @@ def retrieve_value_from_scicat( field_name: str, # variable_recipe["field"] ) -> str: response: dict = requests.get( - scicat_endpoint_url, headers=config.additional_headers, timeout=config.timeout + scicat_endpoint_url, headers=config.headers, timeout=config.timeout ).json() return response[field_name] if field_name else response @@ -55,7 +55,7 @@ def create_scicat_dataset( response = _post_to_scicat( url=config.urls.datasets, posting_obj=dataset, - headers=config.additional_headers, + headers=config.headers, timeout=config.timeout, ) result: dict = response.json() @@ -87,7 +87,7 @@ def create_scicat_origdatablock( response = _post_to_scicat( url=config.urls.origdatablocks, posting_obj=origdatablock, - headers=config.additional_headers, + headers=config.headers, timeout=config.timeout, ) result: dict = response.json() @@ -122,7 +122,7 @@ def check_dataset_by_pid( ) -> bool: response = _get_from_scicat( url=urljoin(config.host_address, f"datasets/{quote(pid)}"), - headers=config.additional_headers, + headers=config.headers, timeout=config.timeout, stream=config.stream, verify=config.verify, @@ -159,7 +159,7 @@ def check_dataset_by_metadata( logger.info("Checking if dataset exists by metadata with url: %s", url) response = _get_from_scicat( url=url, - headers=config.additional_headers, + headers=config.headers, timeout=config.timeout, stream=config.stream, verify=config.verify,