Version:

Entity

Define the entities used in a Profiles project.

Entities are defined in the pb_project.yaml file. They are used throughout a Profiles project and consist of names for the entities and the types of ids associated with each for ID stitching and feature creation.

You can also assign a custom ID stitcher and/or a feature view with specific id_types as the view’s primary key.

entities:
   - name: entity_name
     id_column_name: column_name
     id_stitcher: models/custom_ID_stitcher_path   # Optional
     id_types:
         <id_types-config>
     feature_views:     # Optional
         using_ids:
            - id: id_type
              name: view_name
KeyDescription
name
Required
Entity name.
id_column_nameName of the main ID column for an entity. If not provided explicitly, its value is set to <entity_name>_main_id.
id_stitcherModel path to the ID stitcher for this entity. When you define a custom id_stitcher model in profiles.yaml, set this key so the entity uses that model. If left blank, the default ID stitcher is used.
id_types
Required
List of the identifier types associated with the entity.
feature_viewsList of name and id_type (primary key) for each view.
warning

Always set id_stitcher on each entity that has a custom ID stitcher model defined in profiles.yaml.

If you have an id_stitcher model in profiles.yaml (for example, user_id_stitcher for the user entity) but do not set id_stitcher on the entity, the intended ID stitcher is not used and you may see get unintended results.

Set id_stitcher to the model path (for example, id_stitcher: models/user_id_stitcher).

Example

# Case 1: Minimal example
entities:
    - name: user
      id_column_name: user_rud_id
      id_types:
         - email
         - user_id

# Case 2: With a custom ID stitcher
entities:
    - name: user
      id_stitcher: models/custom_id_stitcher
      id_types:
         - email
         - user_id

# Case 3: With a feature view
entities:
    - name: user
      id_types:
         - email
         - user_id
      feature_views:
         using_ids:
            - id: email
              name: customer_profile_by_email

Note that for the first case in the above example, the id_column_name is explicitly set to user_rud_id.

In the other cases, id_column_name is not explicitly specified, so this field is set to user_main_id by default.


Questions? We're here to help.

Join the RudderStack Slack community or email us for support