MCPcopy Index your code
hub / github.com/feast-dev/feast / describe_feature

Function describe_feature

sdk/python/feast/cli/features.py:64–93  ·  view source on GitHub ↗

Describe a specific feature by name

(ctx: click.Context, feature_name: str)

Source from the content-addressed store, hash-verified

62@click.argument("feature_name", type=str)
63@click.pass_context
64def describe_feature(ctx: click.Context, feature_name: str):
65 """
66 Describe a specific feature by name
67 """
68 store = create_feature_store(ctx)
69 feature_views = [
70 *store.list_batch_feature_views(),
71 *store.list_on_demand_feature_views(),
72 *store.list_stream_feature_views(),
73 ]
74
75 feature_details = []
76 for fv in feature_views:
77 for feature in fv.features:
78 if feature.name == feature_name:
79 feature_details.append(
80 {
81 "Feature Name": feature.name,
82 "Feature View": fv.name,
83 "Data Type": str(feature.dtype),
84 "Description": getattr(feature, "description", "N/A"),
85 "Online Store": getattr(fv, "online", "N/A"),
86 "Source": json.loads(str(getattr(fv, "batch_source", "N/A"))),
87 }
88 )
89 if not feature_details:
90 click.echo(f"Feature '{feature_name}' not found in any feature view.")
91 return
92
93 click.echo(json.dumps(feature_details, indent=4))
94
95
96@click.command("get-online-features")

Callers

nothing calls this directly

Calls 4

create_feature_storeFunction · 0.90

Tested by

no test coverage detected