@@ -68,6 +68,8 @@ async def _write_script(
6868 parent : ElementMixin ,
6969 ** kwargs : Any ,
7070 ) -> StatusEnum :
71+ if TYPE_CHECKING :
72+ assert isinstance (parent , Job )
7173 # Database operations
7274 await session .refresh (parent , attribute_names = ["c_" ])
7375 data_dict = await script .data_dict (session )
@@ -90,7 +92,7 @@ async def _write_script(
9092 # yaml template, NOT the yaml template itself!
9193 workflow_config : dict [str , Any ] = {}
9294 workflow_config ["project" ] = "DEFAULT"
93- workflow_config ["campaign" ] = parent .c_ .name # type: ignore
95+ workflow_config ["campaign" ] = parent .c_ .name
9496 workflow_config ["pipeline_yaml" ] = pipeline_yaml
9597 workflow_config ["lsst_version" ] = lsst_version
9698 workflow_config ["lsst_distrib_dir" ] = lsst_distrib_dir
@@ -170,7 +172,7 @@ async def _write_script(
170172 in_collection = input_colls
171173
172174 payload = {
173- "name" : parent .c_ .name , # type: ignore
175+ "name" : parent .c_ .name ,
174176 "butler_config" : butler_repo ,
175177 "output_run_collection" : run_coll ,
176178 "input_collection" : in_collection ,
@@ -216,7 +218,9 @@ async def _check_slurm_job(
216218 if fake_status is not None :
217219 wms_job_id = "fake_job"
218220 else : # pragma: no cover
219- bps_dict = await parse_bps_stdout (script .log_url ) # type: ignore
221+ if TYPE_CHECKING :
222+ assert script .log_url is not None
223+ bps_dict = await parse_bps_stdout (script .log_url )
220224 wms_job_id = self .get_job_id (bps_dict )
221225 await parent .update_values (session , wms_job_id = wms_job_id )
222226 return slurm_status
@@ -243,7 +247,9 @@ async def _check_htcondor_job(
243247 if fake_status is not None :
244248 wms_job_id = "fake_job"
245249 else : # pragma: no cover
246- bps_dict = await parse_bps_stdout (script .log_url ) # type: ignore
250+ if TYPE_CHECKING :
251+ assert script .log_url is not None
252+ bps_dict = await parse_bps_stdout (script .log_url )
247253 wms_job_id = self .get_job_id (bps_dict )
248254 await parent .update_values (session , wms_job_id = wms_job_id )
249255 return htcondor_status
0 commit comments