Skip to content

Commit

Permalink
Dont choose null task
Browse files Browse the repository at this point in the history
  • Loading branch information
nikodemas committed Mar 5, 2024
1 parent 49a6b14 commit c9109be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpueff-goweb/spark/cpueff_stepchain_goweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def udf_step_extract(row):
_fwjr_id = row['meta_data']['fwjr_id']
_jobtype = row['meta_data']['jobtype']
_ts = row['meta_data']['ts']
if 'steps' in row and row['steps']:
if 'steps' in row and row['steps'] is not None:
for step in filter(None, row['steps']):
if ('name' in step) and step['name'].lower().startswith('cmsrun'):
if 'name' in step and step['name'].lower().startswith('cmsrun'):
step_res = {'Task': _task_name, 'ts': _ts, 'fwjr_id': _fwjr_id, 'JobType': _jobtype}

count += 1
Expand All @@ -88,11 +88,11 @@ def udf_step_extract(row):
step_res['threads_total_job_time'] = step_res['job_time'] * step_res['nthreads']
except Exception:
step_res['threads_total_job_time'] = None
if step['output']:
if 'output' in step and step['output'] is not None:
for outx in step['output']:
if outx['acquisitionEra']:
step_res['acquisition_era'].append(outx['acquisitionEra'])
if 'performance' in step:
if 'performance' in step and step['performance'] is not None:
performance = step['performance']
if 'storage' in performance:
if 'writeTotalMB' in performance['storage']:
Expand Down Expand Up @@ -174,6 +174,7 @@ def main(start_date, end_date, hdfs_out_dir, last_n_days):
.filter(f"""data.meta_data.jobstate='success'
AND data.wmats >= {start_date.timestamp()}
AND data.wmats < {end_date.timestamp()}
AND data.task IS NOT NULL
""")
.filter(col('data.meta_data.jobtype').isin(_PROD_CMS_JOB_TYPES_FILTER))
)
Expand Down

0 comments on commit c9109be

Please sign in to comment.