|
18 | 18 | BigQueryOfflineStoreConfig, |
19 | 19 | BigQueryRetrievalJob, |
20 | 20 | _bq_create_entity_union_table, |
21 | | - _gather_all_entities, |
| 21 | + |
22 | 22 | ) |
| 23 | +from feast.infra.offline_stores.offline_utils import gather_all_entities |
23 | 24 | from feast.infra.offline_stores.bigquery_source import BigQuerySource |
24 | 25 | from feast.infra.offline_stores.offline_utils import FeatureViewQueryContext |
25 | 26 | from feast.infra.online_stores.sqlite import SqliteOnlineStoreConfig |
@@ -101,32 +102,32 @@ def _make_feature_view_mock( |
101 | 102 | class TestGatherAllEntities: |
102 | 103 | def test_single_feature_view(self): |
103 | 104 | ctx = _make_fv_context("fv1", ["customer_id", "item_id"]) |
104 | | - assert _gather_all_entities([ctx]) == ["customer_id", "item_id"] |
| 105 | + assert gather_all_entities([ctx]) == ["customer_id", "item_id"] |
105 | 106 |
|
106 | 107 | def test_multiple_views_overlapping_entities(self): |
107 | 108 | ctx1 = _make_fv_context("fv1", ["customer_id", "item_id"]) |
108 | 109 | ctx2 = _make_fv_context("fv2", ["customer_id", "store_id"]) |
109 | | - result = _gather_all_entities([ctx1, ctx2]) |
| 110 | + result = gather_all_entities([ctx1, ctx2]) |
110 | 111 | # customer_id should appear only once; order is first-seen |
111 | 112 | assert result == ["customer_id", "item_id", "store_id"] |
112 | 113 |
|
113 | 114 | def test_multiple_views_disjoint_entities(self): |
114 | 115 | ctx1 = _make_fv_context("fv1", ["driver_id"]) |
115 | 116 | ctx2 = _make_fv_context("fv2", ["customer_id"]) |
116 | | - result = _gather_all_entities([ctx1, ctx2]) |
| 117 | + result = gather_all_entities([ctx1, ctx2]) |
117 | 118 | assert result == ["driver_id", "customer_id"] |
118 | 119 |
|
119 | 120 | def test_entityless_feature_view(self): |
120 | 121 | ctx = _make_fv_context("fv1", []) |
121 | | - assert _gather_all_entities([ctx]) == [] |
| 122 | + assert gather_all_entities([ctx]) == [] |
122 | 123 |
|
123 | 124 | def test_empty_list(self): |
124 | | - assert _gather_all_entities([]) == [] |
| 125 | + assert gather_all_entities([]) == [] |
125 | 126 |
|
126 | 127 | def test_preserves_insertion_order(self): |
127 | 128 | ctx1 = _make_fv_context("fv1", ["z_entity", "a_entity"]) |
128 | 129 | ctx2 = _make_fv_context("fv2", ["a_entity", "m_entity"]) |
129 | | - result = _gather_all_entities([ctx1, ctx2]) |
| 130 | + result = gather_all_entities([ctx1, ctx2]) |
130 | 131 | assert result == ["z_entity", "a_entity", "m_entity"] |
131 | 132 |
|
132 | 133 |
|
|
0 commit comments