feast.FeastDataset
kedro_datasets_experimental.feast.FeastDataset ¶
FeastDataset(
*,
repo,
credentials=None,
load_args=None,
save_args=None,
metadata=None
)
Bases: AbstractDataset
Kedro dataset backed by a Feast feature view or feature service.
Load returns a FeastFeatureSource for point-in-time queries against the
offline store. Save persists a DataFrame to a feature view's batch source
via Feast's write_to_offline_store (which matches the DataFrame to the
feature view's schema and appends) and, when write_mode is
online_and_offline, also to the online store. Feast infers the write
schema from the existing table; set create_table: true to bootstrap a
(BigQuery) table from the feature view schema when it does not yet exist.
Examples:
Using the YAML API:
feast_features:
type: kedro_datasets_experimental.feast.FeastDataset
repo: # forwarded to feast.RepoConfig
registry: gs://bucket/feast
project: project_name
provider: gcp # default is local
offline_store:
type: bigquery # default is bigquery
location: EU
online_store: # optional; required for online_and_offline writes
type: sqlite
path: /tmp/online_store.db
save_args:
feature_view_name: features
write_mode: online_and_offline # or "offline" (default)
create_table: true # bootstrap the BigQuery table from the FV schema
load_args:
feature_view_name: features
Parameters:
-
repo(dict[str, Any]) –Feast repo configuration, forwarded to
feast.RepoConfig(which validates it). AnyRepoConfigfield is accepted, e.g.registry(a path string or dict),project,providerandoffline_store.providerdefaults to"local"andoffline_storeto{"type": "bigquery"}when not set; either can be overridden viarepo.online_storedefaults to disabled (None); set it inrepoto enableonline_and_offlinewrites. -
credentials(dict[str, Any] | str | None, default:None) –Not supported; Feast authenticates via Application Default Credentials (the ambient environment). Passing anything other than
NoneraisesNotImplementedError. -
load_args(dict[str, Any] | None, default:None) –Must contain either
feature_view_nameorfeature_service_nameidentifying whatloadretrieves. -
save_args(dict[str, Any] | None, default:None) –Must contain
feature_view_name— the feature view to write to. Optionalwrite_modeselects where to write:"offline"(default) writes only the offline store;"online_and_offline"also pushes to the online store (requires anonline_storeinrepo). Optionalcreate_table(defaultFalse): whenTrue, create the backing table from the feature view schema if it does not exist (BigQuery sources only; raises aDatasetErrorotherwise).
Source code in kedro_datasets_experimental/feast/feast_dataset.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
load ¶
load()
Source code in kedro_datasets_experimental/feast/feast_dataset.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
save ¶
save(data)
Source code in kedro_datasets_experimental/feast/feast_dataset.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |