MCPcopy Create free account
hub / github.com/feast-dev/feast / execute_job

Method execute_job

sdk/python/feast/monitoring/dqm_job_manager.py:103–149  ·  view source on GitHub ↗

Execute a DQM job synchronously. Manages status transitions.

(self, job_id: str, monitoring_service)

Source from the content-addressed store, hash-verified

101 self._offline_store.save_monitoring_metrics(self._config, "job", [job])
102
103 def execute_job(self, job_id: str, monitoring_service) -> Dict[str, Any]:
104 """Execute a DQM job synchronously. Manages status transitions."""
105 job = self.get_job(job_id)
106 if job is None:
107 raise ValueError(f"Failed to find DQM job '{job_id}'")
108
109 self.update_status(job_id, JOB_STATUS_RUNNING)
110
111 try:
112 params = job.get("parameters") or {}
113 job_type = job["job_type"]
114 project = job["project_id"]
115
116 if job_type == "auto_compute":
117 result = monitoring_service.auto_compute(
118 project=project,
119 feature_view_name=job.get("feature_view_name"),
120 )
121 elif job_type == "baseline":
122 result = monitoring_service.compute_baseline(
123 project=project,
124 feature_view_name=job.get("feature_view_name"),
125 feature_names=params.get("feature_names"),
126 )
127 elif job_type == "compute":
128 result = monitoring_service.compute_metrics(
129 project=project,
130 feature_view_name=job.get("feature_view_name"),
131 feature_names=params.get("feature_names"),
132 start_date=date.fromisoformat(params["start_date"])
133 if params.get("start_date")
134 else None,
135 end_date=date.fromisoformat(params["end_date"])
136 if params.get("end_date")
137 else None,
138 granularity=params.get("granularity", "daily"),
139 set_baseline=params.get("set_baseline", False),
140 )
141 else:
142 raise ValueError(f"Unknown job type '{job_type}'")
143
144 self.update_status(job_id, JOB_STATUS_COMPLETED, result_summary=result)
145 return result
146
147 except Exception as e:
148 self.update_status(job_id, JOB_STATUS_FAILED, error_message=str(e))
149 raise

Callers 3

_run_baseline_jobsFunction · 0.45
compute_metricsFunction · 0.45
auto_computeFunction · 0.45

Calls 6

get_jobMethod · 0.95
update_statusMethod · 0.95
getMethod · 0.80
auto_computeMethod · 0.80
compute_baselineMethod · 0.80
compute_metricsMethod · 0.80

Tested by

no test coverage detected