diff --git a/PBS_Utils/scripts/plquery.py b/PBS_Utils/scripts/plquery.py index 9638ab14e3488a6f90a87ce83fa40561894975af..845ee2c3ea587fbb5d9cad41b5ed9f703fca86f2 100755 --- a/PBS_Utils/scripts/plquery.py +++ b/PBS_Utils/scripts/plquery.py @@ -1014,10 +1014,12 @@ def job(settings: Settings, extend): if not settings.header: settings.header = [ "jobid", + "Job_Name", "queue", "job_state", "substate", "stime", + "obittime", # 'Resource_List.nodect', "nodect", # 'Resource_List.walltime', 'resources_used.walltime', @@ -1027,6 +1029,7 @@ def job(settings: Settings, extend): "real_runtime", "job_stuck", "vnode", + "Exit_status", ] df_jobs["substate"] = df_jobs.get("substate", default=pd.Series(dtype=object)).apply( lambda ser: "".join(state_to_strings(data.enum_lookup, "LONG__REVERSE_JOB_SUBSTATE", ser)).replace("JOB_SUBSTATE_", "") @@ -1039,7 +1042,17 @@ def job(settings: Settings, extend): # this makes lots of rows. Maybe have a split option for this data. # df_jobs['exec_vnode'] = df_jobs['exec_vnode'].apply(wrap_cast_to_vnode_list) df_jobs["exec_vnode"] = df_jobs.get("exec_vnode", default=pd.Series(dtype=object)).apply(wrap_cast_to_vnode_list) - df_jobs = split_column_lst_into_series(df_jobs, "exec_vnode", "vnode") + df_jobs['vnode'] = df_jobs["exec_vnode"].apply(lambda l: len(l)) + # df_jobs = split_column_lst_into_series(df_jobs, "exec_vnode", "vnode") + int_cols = ['Exit_status', 'run_count'] + for int_col in int_cols: + if int_col in settings.header: + df_jobs[int_col] = df_jobs[int_col].apply(lambda e: int(e) if e and e > 0 else '-') + time_cols = ['stime', 'etime', 'obittime', 'eligible_time', 'ctime'] + for time_col in time_cols: + if time_col in settings.header: + df_jobs[time_col] = df_jobs[time_col].apply(lambda t: epoch_to_datetime(t) if t and t > 0 else '-') + df = df_jobs df = df_apply_options(df, settings) df_display(df, settings)