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

Function generate_feast_code

sdk/python/feast/dbt/codegen.py:382–423  ·  view source on GitHub ↗

Convenience function to generate Feast code from dbt models. Args: models: List of DbtModel objects entity_columns: Entity column name(s) - single string or list of strings data_source_type: Type of data source (bigquery, snowflake, file) timestamp_field: Ti

(
    models: List[DbtModel],
    entity_columns: Union[str, List[str]],
    data_source_type: str = "bigquery",
    timestamp_field: str = "event_timestamp",
    ttl_days: int = 1,
    manifest_path: str = "",
    project_name: str = "",
    exclude_columns: Optional[List[str]] = None,
    online: bool = True,
)

Source from the content-addressed store, hash-verified

380
381
382def generate_feast_code(
383 models: List[DbtModel],
384 entity_columns: Union[str, List[str]],
385 data_source_type: str = "bigquery",
386 timestamp_field: str = "event_timestamp",
387 ttl_days: int = 1,
388 manifest_path: str = "",
389 project_name: str = "",
390 exclude_columns: Optional[List[str]] = None,
391 online: bool = True,
392) -> str:
393 """
394 Convenience function to generate Feast code from dbt models.
395
396 Args:
397 models: List of DbtModel objects
398 entity_columns: Entity column name(s) - single string or list of strings
399 data_source_type: Type of data source (bigquery, snowflake, file)
400 timestamp_field: Timestamp column name
401 ttl_days: TTL in days for feature views
402 manifest_path: Path to manifest for documentation
403 project_name: Project name for documentation
404 exclude_columns: Columns to exclude from features
405 online: Whether to enable online serving
406
407 Returns:
408 Generated Python code as a string
409 """
410 generator = DbtCodeGenerator(
411 data_source_type=data_source_type,
412 timestamp_field=timestamp_field,
413 ttl_days=ttl_days,
414 )
415
416 return generator.generate(
417 models=models,
418 entity_columns=entity_columns,
419 manifest_path=manifest_path,
420 project_name=project_name,
421 exclude_columns=exclude_columns,
422 online=online,
423 )

Calls 2

generateMethod · 0.95
DbtCodeGeneratorClass · 0.85