Beispiel #1
0
    def list_ingest_jobs(
        self,
        job_id: str = None,
        feature_set_ref: FeatureSetRef = None,
        store_name: str = None,
    ):
        """
        List the ingestion jobs currently registered in Feast, with optional filters.
        Provides detailed metadata about each ingestion job.

        Args:
            job_id: Select specific ingestion job with the given job_id
            feature_set_ref: Filter ingestion jobs by target feature set (via reference)
            store_name: Filter ingestion jobs by target feast store's name

        Returns:
            List of IngestJobs matching the given filters
        """
        self._connect_core()
        # construct list request
        feature_set_ref = None
        list_filter = ListIngestionJobsRequest.Filter(
            id=job_id,
            feature_set_reference=feature_set_ref,
            store_name=store_name,
        )
        request = ListIngestionJobsRequest(filter=list_filter)
        # make list request & unpack response
        response = self._core_service_stub.ListIngestionJobs(request)
        ingest_jobs = [
            IngestJob(proto, self._core_service_stub)
            for proto in response.jobs
        ]
        return ingest_jobs
Beispiel #2
0
    def test_stop_ingest_job(self, mocked_client, mocker):
        mocker.patch.object(
            mocked_client,
            "_core_service_stub",
            return_value=Core.CoreServiceStub(grpc.insecure_channel("")),
        )

        ingest_job = IngestJob(
            job_proto=IngestJobProto(
                id="kafka-to-redis",
                external_id="job#2222",
                status=IngestionJobStatus.RUNNING,
            ),
            core_stub=mocked_client._core_service_stub,
        )

        mocked_client.stop_ingest_job(ingest_job)
        assert mocked_client._core_service_stub.StopIngestionJob.called
Beispiel #3
0
    def list_ingest_jobs(
        self,
        job_id: str = None,
        feature_set_ref: FeatureSetRef = None,
        store_name: str = None,
    ):
        """
        List the ingestion jobs currently registered in Feast, with optional filters.
        Provides detailed metadata about each ingestion job.

        Args:
            job_id: Select specific ingestion job with the given job_id
            feature_set_ref: Filter ingestion jobs by target feature set (via reference)
            store_name: Filter ingestion jobs by target feast store's name

        Returns:
            List of IngestJobs matching the given filters
        """
        # construct list request
        feature_set_ref_proto = None
        if feature_set_ref:
            feature_set_ref_proto = feature_set_ref.to_proto()
        list_filter = ListIngestionJobsRequest.Filter(
            id=job_id,
            feature_set_reference=feature_set_ref_proto,
            store_name=store_name,
        )
        request = ListIngestionJobsRequest(filter=list_filter)
        # make list request & unpack response
        response = self._core_service.ListIngestionJobs(
            request,
            metadata=self._get_grpc_metadata(),
        )  # type: ignore
        ingest_jobs = [
            IngestJob(proto,
                      self._core_service,
                      auth_metadata_plugin=self._auth_metadata)
            for proto in response.jobs  # type: ignore
        ]

        return ingest_jobs