in dagify/converter/utils.py [0:0]
def filter_jobs_by_parameter_in_child(xml_file_path, parameter_name, child_element_name=None):
"""Function to return job_name with a particular paramter"""
tree = ET.parse(xml_file_path)
root = tree.getroot()
matching_job_names = []
for job in root.findall('.//JOB'):
if child_element_name:
child_element = job.find(f'./{child_element_name}')
if child_element is not None and child_element.attrib.get(parameter_name) is not None:
matching_job_names.append(job.attrib['JOBNAME'])
else: # Search within the JOB tag itself
if job.attrib.get(parameter_name) is not None:
matching_job_names.append(job.attrib['JOBNAME'])
return matching_job_names