Skip to content

Commit

Permalink
Fix exposure_id passing to pipetask.
Browse files Browse the repository at this point in the history
The exposure_ids are stored in a tuple, which converts nicely to an
SQL query if the tuple has more than one element.  If it has just one
element, there's a trailing comma that breaks the parsing.
  • Loading branch information
czwa committed Jan 14, 2025
1 parent 438c24d commit bc8e1c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/lsst/ts/externalscripts/base_make_calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,13 +776,14 @@ async def call_pipetask(self, image_type):
pipeline_yaml_file = f"${{CP_PIPE_DIR}}/pipelines/_ingredients/{pipe_yaml}"

# This returns the in-progress acknowledgement with the job identifier
exposure_id_string = str(exposure_ids) if len(exposure_ids) > 1 else f"({exposure_ids[0]})"
ack = await self.ocps.cmd_execute.set_start(
wait_done=False,
pipeline=f"{pipeline_yaml_file}",
version="",
config=f"{config_string}",
data_query=f"instrument='{self.instrument_name}' AND"
f" detector IN {self.detectors_string} AND exposure IN {exposure_ids}",
f" detector IN {self.detectors_string} AND exposure IN {exposure_id_string}",
)
self.log.debug(
f"Received acknowledgement of ocps command for {image_type} pipetask."
Expand Down Expand Up @@ -997,13 +998,14 @@ async def verify_calib(self, image_type, job_id_calib):
pipeline_yaml_file = f"${{CP_VERIFY_DIR}}/pipelines/{pipe_yaml}"

# Verify the combined calibration
exposure_id_string = str(exposure_ids) if len(exposure_ids) > 1 else f"({exposure_ids[0]})"
ack = await self.ocps.cmd_execute.set_start(
wait_done=False,
pipeline=f"{pipeline_yaml_file}",
version="",
config=f"{config_string}",
data_query=f"instrument='{self.instrument_name}' AND"
f" detector IN {self.detectors_string} AND exposure IN {exposure_ids}",
f" detector IN {self.detectors_string} AND exposure IN {exposure_id_string}",
)
self.log.debug(
f"Received acknowledgement of ocps command for {image_type} verification."
Expand Down

0 comments on commit bc8e1c1

Please sign in to comment.