Granular OpenLineage event emission on `feast apply` for precise FeatureView lineage

Aperta
#6,852 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start in sdk/python/feast/openlineage/emitter.py at emit_apply(), then compare feature_view_to_job() and emit_feature_view_lineage() in mappers.py and the edge handling in processor.py. Done means each FeatureView, StreamFeatureView, and OnDemandFeatureView emits its own event with only its declared inputs and its dataset output, while preserving the existing per-service behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/feature

Is your feature request related to a problem? Please describe.
When openlineage.emit_on_apply: true is enabled in feature_store.yaml, running feast apply currently aggregates all defined data sources, entities, and feature views into a single bulk definition job event (feast.<project>.feature_views).

Because OpenLineage lineage engines (including Feast's lineage consumer) infer dataset-to-dataset relationships from job inputs and outputs, placing all data sources as inputs and all feature views as outputs of the same job causes the lineage graph to form a full $(M \times N)$ Cartesian product. Every data source appears connected to every feature view (as dashed derived edges), regardless of whether they are actually related in the feature store definitions.

In feature stores with multiple data sources and feature views, this makes the OpenLineage lineage graph cluttered and inaccurate for downstream consumers and the UI.

Describe the solution you'd like

FeastOpenLineageEmitter.emit_apply() could emit more granular, per-FeatureView definition events instead of a single monolithic job event.
Specifically:

  1. For each FeatureView / StreamFeatureView / OnDemandFeatureView, emit a distinct definition event where:
    • inputs: Only the data sources and entities declared for that specific feature view.
    • outputs: That specific feature view dataset.
  2. Maintain the existing pattern used for FeatureService definitions (which are already emitted individually per service).
    This ensures that OpenLineage accurately captures the true 1:1 or N:1 dependency graph between sources and feature views both in Feast UI and in external lineage backends (e.g., Marquez, DataHub, Atlan).

Describe alternatives you've considered

  1. Relying on the UI's Feast Registry Lineage toggle:
    • While the built-in "Feast registry lineage" view correctly parses definitions directly from the registry proto, it does not help external OpenLineage consumers/catalogs that rely on standard OpenLineage event streams emitted during CI/CD or feast apply.
  2. Filtering or matching datasets in the backend processor:
    • Having OpenLineageProcessor inspect facets to filter out unrelated edges is fragile. Emitting accurate event boundaries at the source (FeastOpenLineageEmitter) adheres more closely to OpenLineage design principles.

Additional context

Technical Details
  • Bulk emission in emitter:
    In sdk/python/feast/openlineage/emitter.py within emit_apply(), all sources and entities are collected into fv_inputs, and all feature views are collected into fv_outputs:

    # sdk/python/feast/openlineage/emitter.py
    result1 = self._client.emit_run_event(
        job_name=feature_views_job_name(project),
        run_id=str(uuid.uuid4()),
        event_type=RunState.COMPLETE,
        inputs=fv_inputs,
        outputs=fv_outputs,
        job_facets=job_facets,
        namespace=namespace,
    )
    
  • Transitive edge derivation:
    In sdk/python/feast/openlineage/processor.py, _build_dataset_to_dataset_edges() maps all job inputs to all job outputs:

    # sdk/python/feast/openlineage/processor.py
    for inp in inputs:
        for out in outputs:
            self._store.upsert_lineage_edge(
                source_type="dataset",
                source_name=inp["name"],
                target_type="dataset",
                target_name=out["name"],
                edge_type="derived",
            )
    
  • Existing helper:
    feature_view_to_job() and emit_feature_view_lineage() in sdk/python/feast/openlineage/mappers.py already implement per-view mapping logic, which can be reused or aligned with emit_apply().

Lingua principale
Python
Stelle
7.4k
Fork
1.5k
Merge medio
2g 6h
PR unite (30g)
107

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di feast-dev/feast

Tutte le issue di feast-dev/feast

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.