From cbe1d881e71feec2973e4dbcd4355f64cc68d074 Mon Sep 17 00:00:00 2001 From: Peter Onyisi Date: Tue, 12 Nov 2024 19:03:23 -0600 Subject: [PATCH 1/2] Push intermediate results --- src/servicex_did_finder_lib/did_finder_app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/servicex_did_finder_lib/did_finder_app.py b/src/servicex_did_finder_lib/did_finder_app.py index 87407e5..b167f4e 100644 --- a/src/servicex_did_finder_lib/did_finder_app.py +++ b/src/servicex_did_finder_lib/did_finder_app.py @@ -97,8 +97,11 @@ def do_lookup(self, did: str, dataset_id: int, endpoint: str, user_did_finder: U try: for file_info in user_did_finder(did_info.did, info, self.app.did_finder_args): acc.add(file_info) + if did_info.file_count == -1: + acc.send_on(-1) # if looking up full dataset, can send partial results - acc.send_on(did_info.file_count) + if did_info.file_count > 0: # otherwise wait until all files arrive, then limit results + acc.send_on(did_info.file_count) except Exception: # noinspection PyTypeChecker self.logger.error( From 6866f92424a41a7bd282acbf6d726dce979a1186 Mon Sep 17 00:00:00 2001 From: Peter Onyisi Date: Tue, 12 Nov 2024 19:08:40 -0600 Subject: [PATCH 2/2] Flake8 fix --- src/servicex_did_finder_lib/did_finder_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/servicex_did_finder_lib/did_finder_app.py b/src/servicex_did_finder_lib/did_finder_app.py index b167f4e..06c6306 100644 --- a/src/servicex_did_finder_lib/did_finder_app.py +++ b/src/servicex_did_finder_lib/did_finder_app.py @@ -100,7 +100,7 @@ def do_lookup(self, did: str, dataset_id: int, endpoint: str, user_did_finder: U if did_info.file_count == -1: acc.send_on(-1) # if looking up full dataset, can send partial results - if did_info.file_count > 0: # otherwise wait until all files arrive, then limit results + if did_info.file_count > 0: # otherwise wait until all files arrive then limit results acc.send_on(did_info.file_count) except Exception: # noinspection PyTypeChecker