Describe a specific feature by name
(ctx: click.Context, feature_name: str)
| 62 | @click.argument("feature_name", type=str) |
| 63 | @click.pass_context |
| 64 | def 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") |
nothing calls this directly
no test coverage detected