featurebyte.Feature.save¶
Description¶
Adds a Feature object to the catalog. A conflict could be triggered when the object being saved has violated a uniqueness check at the catalog. If uniqueness is violated, you can either raise an error or retrieve the object with the same name, depending on the conflict resolution parameter passed in. The default behavior is to raise an error.
Parameters¶
- conflict_resolution: Literal["raise", "retrieve"]
default: "raise"
"raise" will raise an error when we encounter a conflict error.
"retrieve" will handle the conflict error by retrieving the object with the same name.
Examples¶
>>> grocery_invoice_view = catalog.get_view("GROCERYINVOICE")
>>> invoice_amount_avg_60days = grocery_invoice_view.groupby("GroceryCustomerGuid").aggregate_over(
... value_column="Amount",
... method="avg",
... feature_names=["InvoiceAmountAvg_60days"],
... windows=["60d"],
... )["InvoiceAmountAvg_60days"]