Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename FeastType to ComplexFeastType
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed Apr 4, 2022
commit d592c465f2f916dd2d52d4829537d8da67e44382
24 changes: 12 additions & 12 deletions sdk/python/feast/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
}


class FeastType(ABC):
class ComplexFeastType(ABC):
"""
A FeastType represents a structured type that is recognized by Feast.
A ComplexFeastType represents a structured type that is recognized by Feast.
"""

def __init__(self):
"""Creates a FeastType object."""
"""Creates a ComplexFeastType object."""
pass

@abstractmethod
def to_int(self) -> int:
"""
Converts a FeastType object to the appropriate int value corresponding to
Converts a ComplexFeastType object to the appropriate int value corresponding to
the correct ValueTypeProto.Enum value.
"""
raise NotImplementedError
Expand All @@ -56,11 +56,11 @@ class PrimitiveFeastType(Enum):
INVALID = 0
BYTES = 1
STRING = 2
BOOL = 3
INT32 = 4
INT64 = 5
FLOAT32 = 6
FLOAT64 = 7
INT32 = 3
INT64 = 4
FLOAT32 = 5
FLOAT64 = 6
BOOL = 7
UNIX_TIMESTAMP = 8

def to_int(self) -> int:
Expand Down Expand Up @@ -92,17 +92,17 @@ def to_int(self) -> int:
]


class Array(FeastType):
class Array(ComplexFeastType):
"""
An Array represents a list of types.

Attributes:
base_type: The base type of the array.
"""

base_type: Union[PrimitiveFeastType, FeastType]
base_type: Union[PrimitiveFeastType, ComplexFeastType]

def __init__(self, base_type: Union[PrimitiveFeastType, FeastType]):
def __init__(self, base_type: Union[PrimitiveFeastType, ComplexFeastType]):
if base_type not in SUPPORTED_BASE_TYPES:
raise ValueError(
f"Type {type(base_type)} is currently not supported as a base type for Array."
Expand Down