@@ -33,9 +33,6 @@ class Entity:
3333 Attributes:
3434 name: The unique name of the entity.
3535 value_type: The type of the entity, such as string or float.
36- join_keys: A list of properties that uniquely identifies different entities within the
37- collection. This currently only supports a list of size one, but is intended to
38- eventually support multiple join keys.
3936 join_key: A property that uniquely identifies different entities within the
4037 collection. The join_key property is typically used for joining entities
4138 with their associated features. If not specified, defaults to the name.
@@ -48,7 +45,6 @@ class Entity:
4845
4946 name : str
5047 value_type : ValueType
51- join_keys : List [str ]
5248 join_key : str
5349 description : str
5450 tags : Dict [str , str ]
@@ -84,21 +80,17 @@ def __init__(
8480 self .name = name
8581 self .value_type = ValueType .UNKNOWN
8682
87- # For now, both the `join_key` and `join_keys` attributes are set correctly,
88- # so both are usable.
89- # TODO(felixwang9817): Fully remove the usage of `join_key` throughout the codebase,
90- # at which point the `join_key` attribute no longer needs to be set.
9183 if join_keys and len (join_keys ) > 1 :
84+ # TODO(felixwang9817): When multiple join keys are supported, add a `join_keys` attribute
85+ # and deprecate the `join_key` attribute.
9286 raise ValueError (
93- "An entity may only have single join key. "
87+ "An entity may only have a single join key. "
9488 "Multiple join keys will be supported in the future."
9589 )
9690 elif join_keys and len (join_keys ) == 1 :
97- self .join_keys = join_keys
9891 self .join_key = join_keys [0 ]
9992 else :
10093 self .join_key = self .name
101- self .join_keys = [self .join_key ]
10294
10395 self .description = description
10496 self .tags = tags if tags is not None else {}
0 commit comments