def _op_compare(run, index): """Returns compare cols for run. If we can get the current compare cols for the run op source definition (in the Guild file) we use that, otherwise we use the run "compare" attr. """ return util.find_apply([ lambda: run_util.latest_compare(run), lambda: _default_run_compare(run, index) ])
def _run_compare_metrics(run): compare_specs = run_util.latest_compare(run) if not compare_specs: return None metrics = set() for spec in compare_specs: try: select = query.parse_colspec(spec) except query.ParseError: pass else: metrics.update([col.key for col in select.cols if _is_last_scalar(col)]) return metrics