featurebyte.Treatment.get_by_id¶
get_by_id(
id: ObjectId
) -> ApiObjectTDescription¶
Retrieve the object from the persistent data store given the object's ID. This assumes that the object has been saved to the persistent data store. If the object has not been saved, an exception will be raised and you should create and save the object first.
Parameters¶
- id: ObjectId
Object ID value.
Returns¶
- ApiObjectT
ApiObject object of the given object ID.
Examples¶
Note that the examples below are not exhaustive.
Get an Entity object that is already saved.
>>> fb.Entity.get_by_id(grocery_customer_entity_id)
<featurebyte.api.entity.Entity at 0x7f511dda3bb0>
{
'name': 'grocerycustomer',
'created_at': '2023-03-22T04:08:21.668000',
'updated_at': '2023-03-22T04:08:22.050000',
'serving_names': [
'GROCERYCUSTOMERGUID'
],
'catalog_name': 'grocery'
}