ConflictingFeatureViewNames raised across projects when a LabelView shares a name with another feature view type

オープン 初心者向け
#7,305 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
database

調査の方向性

sdk/python/feast/infra/registry/registry.pyのRegistry._existing_feature_view_names_to_fvsから始め、LabelViewの検索と他のビュー型に対するプロジェクトフィルターを比較してください。test_cross_project_name_does_not_conflict_batch_vs_streamの隣に、異なるプロジェクトで同じ名前を持つLabelViewとFeatureViewを対象とし、FeatureViewの再適用も含めた回帰テストを追加してください。両方の操作が競合なく成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Expected Behavior

Feature view names only need to be unique within a project. A LabelView named shared_name in project_a should not conflict with a FeatureView named shared_name in project_b, and should not block re-applying that FeatureView.

Current Behavior

With the file-based registry, apply_feature_view raises ConflictingFeatureViewNames when a LabelView with the same name exists in a different project.

Registry._existing_feature_view_names_to_fvs (sdk/python/feast/infra/registry/registry.py) filters on-demand, batch and stream feature views by spec.project == project, but builds its LabelView dict from every project:

lvs = {lv.spec.name: lv for lv in self.cached_registry_proto.label_views}

That dict is merged last, so a LabelView in another project is treated as an existing view of a different type. Re-applying an existing FeatureView in its own project is also rejected once a same-named LabelView exists in another project, because the LabelView entry overwrites it in the merged dict.

This looks like the same problem fixed for the other view types in #6209 / #6369; the LabelView lookup was added afterwards (#6292) without the project filter.

Steps to reproduce

import tempfile
from pathlib import Path

from feast import Entity, Field, FeatureView
from feast.infra.offline_stores.file_source import FileSource
from feast.infra.registry.registry import Registry
from feast.labeling.label_view import LabelView
from feast.repo_config import RegistryConfig
from feast.types import Int64, String
from feast.value_type import ValueType

registry = Registry(
    "demo", RegistryConfig(path=str(Path(tempfile.mkdtemp()) / "registry.db")), None
)
entity = Entity(name="driver", value_type=ValueType.STRING, join_keys=["driver_id"])
registry.apply_entity(entity, "project_a")
registry.apply_entity(entity, "project_b")

label_view = LabelView(
    name="shared_name",
    entities=[entity],
    schema=[Field(name="label", dtype=String)],
)
feature_view = FeatureView(
    name="shared_name",
    entities=[entity],
    schema=[Field(name="value", dtype=Int64)],
    source=FileSource(path="data.parquet", timestamp_field="ts"),
)

registry.apply_feature_view(label_view, "project_a")
registry.apply_feature_view(feature_view, "project_b")  # raises

feast.errors.ConflictingFeatureViewNames: The feature view name: shared_name
refers to feature views of different types.

Applying the FeatureView in project_b first, then the LabelView in project_a, and then re-applying the FeatureView in project_b fails the same way.

Specifications
  • Version: master at 9b45df0 (0.69.0)
  • Platform: Windows 11, Python 3.13.9
  • Subsystem: Python SDK, file registry (feast/infra/registry/registry.py)

Possible Solution

Filter the LabelView dict by project like the other three:

lvs = {
    lv.spec.name: lv
    for lv in self.cached_registry_proto.label_views
    if lv.spec.project == project
}

I can open a PR with a regression test next to test_cross_project_name_does_not_conflict_batch_vs_stream.

主要言語
Python
スター
7.4k
フォーク
1.5k
平均マージ
2日 6時間
マージ済み PR(30日)
107

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

feast-dev/feast のほかの issue

feast-dev/feast の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。