MCPcopy
hub / github.com/feast-dev/feast / plan

Method plan

sdk/python/feast/feature_store.py:1147–1235  ·  view source on GitHub ↗

Dry-run registering objects to metadata store. The plan method dry-runs registering one or more definitions (e.g., Entity, FeatureView), and produces a list of all the changes the that would be introduced in the feature repo. The changes computed by the plan command are for

(
        self,
        desired_repo_contents: RepoContents,
        skip_feature_view_validation: bool = False,
        progress_ctx: Optional["ApplyProgressContext"] = None,
    )

Source from the content-addressed store, hash-verified

1145 return feature_views_to_materialize
1146
1147 def plan(
1148 self,
1149 desired_repo_contents: RepoContents,
1150 skip_feature_view_validation: bool = False,
1151 progress_ctx: Optional["ApplyProgressContext"] = None,
1152 ) -> Tuple[RegistryDiff, InfraDiff, Infra]:
1153 """Dry-run registering objects to metadata store.
1154
1155 The plan method dry-runs registering one or more definitions (e.g., Entity, FeatureView), and produces
1156 a list of all the changes the that would be introduced in the feature repo. The changes computed by the plan
1157 command are for informational purposes, and are not actually applied to the registry.
1158
1159 Args:
1160 desired_repo_contents: The desired repo state.
1161 skip_feature_view_validation: If True, skip validation of feature views. This can be useful when the validation
1162 system is being overly strict. Use with caution and report any issues on GitHub. Default is False.
1163
1164 Raises:
1165 ValueError: The 'objects' parameter could not be parsed properly.
1166
1167 Examples:
1168 Generate a plan adding an Entity and a FeatureView.
1169
1170 >>> from feast import FeatureStore, Entity, FeatureView, Feature, FileSource, RepoConfig
1171 >>> from feast.feature_store import RepoContents
1172 >>> from datetime import timedelta
1173 >>> fs = FeatureStore(repo_path="project/feature_repo")
1174 >>> driver = Entity(name="driver_id", description="driver id")
1175 >>> driver_hourly_stats = FileSource(
1176 ... path="data/driver_stats.parquet",
1177 ... timestamp_field="event_timestamp",
1178 ... created_timestamp_column="created",
1179 ... )
1180 >>> driver_hourly_stats_view = FeatureView(
1181 ... name="driver_hourly_stats",
1182 ... entities=[driver],
1183 ... ttl=timedelta(seconds=86400 * 1),
1184 ... source=driver_hourly_stats,
1185 ... )
1186 >>> registry_diff, infra_diff, new_infra = fs.plan(RepoContents(
1187 ... projects=[Project(name="project")],
1188 ... data_sources=[driver_hourly_stats],
1189 ... feature_views=[driver_hourly_stats_view],
1190 ... on_demand_feature_views=list(),
1191 ... stream_feature_views=list(),
1192 ... label_views=list(),
1193 ... entities=[driver],
1194 ... feature_services=list(),
1195 ... permissions=list())) # register entity and feature view
1196 """
1197 # Validate and run inference on all the objects to be registered.
1198 if not skip_feature_view_validation:
1199 self._validate_all_feature_views(
1200 desired_repo_contents.feature_views,
1201 desired_repo_contents.on_demand_feature_views,
1202 desired_repo_contents.stream_feature_views,
1203 desired_repo_contents.label_views,
1204 )

Callers 2

planFunction · 0.45

Calls 12

_make_inferencesMethod · 0.95
diff_betweenFunction · 0.90
diff_infra_protosFunction · 0.90
_validate_data_sourcesFunction · 0.85
update_phase_progressMethod · 0.80
to_registry_protoMethod · 0.80
refreshMethod · 0.45
to_protoMethod · 0.45
get_infraMethod · 0.45
plan_infraMethod · 0.45

Tested by

no test coverage detected