diff --git a/examples/FuncADL_Uproot_Dict.py b/examples/FuncADL_Uproot_Dict.py old mode 100644 new mode 100755 diff --git a/servicex/servicex_adapter.py b/servicex/servicex_adapter.py index bb6ee4a1..6a628259 100644 --- a/servicex/servicex_adapter.py +++ b/servicex/servicex_adapter.py @@ -28,6 +28,7 @@ import os import time import datetime +from rich import get_console from typing import Optional, Dict, List from dataclasses import dataclass @@ -363,6 +364,12 @@ async def submit_transform(self, transform_request: TransformRequest) -> str: headers=headers, json=transform_request.model_dump(by_alias=True, exclude_none=True), ) + + if r.status_code >= 400: + console = get_console() + message = await _extract_message(r) + console.log(message) + if r.status_code == 401: raise AuthorizationError( f"Not authorized to access serviceX at {self.url}" diff --git a/servicex/topcp/topcp.py b/servicex/topcp/topcp.py index 98a80d97..538c0a3e 100644 --- a/servicex/topcp/topcp.py +++ b/servicex/topcp/topcp.py @@ -52,6 +52,8 @@ class TopCPQuery(QueryStringGenerator): """Toggles off the computation of systematics""" no_filter: Optional[bool] = False """Save all events regardless of analysis filters (still saves the decision)""" + image: Optional[str] = None + """Docker image to use""" @pydantic.model_validator(mode="after") def no_input_yaml(self): @@ -85,6 +87,10 @@ def generate_selection_string(self): "no_systematics": self.no_systematics, "no_filter": self.no_filter, } + + if self.image is not None: + query["image"] = self.image + return json.dumps(query) @classmethod diff --git a/tests/test_topcp_dataset.py b/tests/test_topcp_dataset.py index 46c3577a..c211541c 100644 --- a/tests/test_topcp_dataset.py +++ b/tests/test_topcp_dataset.py @@ -113,3 +113,21 @@ def test_yaml_serialization(): def test_no_yaml(): with pytest.raises(ValueError): TopCPQuery() + + +def test_docker_image(tmp_path): + reco_file = tmp_path / "reco.yaml" + reco_file.write_text( + """ +CommonServices: + runSystematics: False + """ + ) + + docker_image = "my-custom-image:latest" + topcp_query = TopCPQuery(reco=reco_file, image=docker_image) + query_string = topcp_query.generate_selection_string() + query = json.loads(query_string) + + assert "image" in query, "Missing image key" + assert query["image"] == docker_image