Skip to content
Merged

Model #769

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
c6acae3
Add Data Models in Feathr
hyingyang-linkedin Sep 13, 2022
45a05ac
Update models.py
hyingyang-linkedin Sep 15, 2022
0696648
Update models.py
hyingyang-linkedin Sep 20, 2022
5cc163d
Update models.py
hyingyang-linkedin Sep 21, 2022
53dfb5e
Update models.py
hyingyang-linkedin Sep 21, 2022
9d9af5f
Update models.py
hyingyang-linkedin Sep 21, 2022
0133fff
Merge branch 'model' of https://github.com/hyingyang-linkedin/feathr …
hyingyang-linkedin Sep 27, 2022
50ddce9
Update models
hyingyang-linkedin Sep 27, 2022
2cd0b9d
Merge branch 'model' of https://github.com/hyingyang-linkedin/feathr …
hyingyang-linkedin Sep 27, 2022
d07c922
Update comment based on PR review comments
hyingyang-linkedin Sep 27, 2022
dbe39db
Merge branch 'model' of https://github.com/hyingyang-linkedin/feathr …
hyingyang-linkedin Sep 27, 2022
79de04d
To make Source of DerivedFeature to be one object, addine MultiFeaure…
hyingyang-linkedin Sep 27, 2022
9e7e45b
Merge branch 'model' of https://github.com/hyingyang-linkedin/feathr …
hyingyang-linkedin Sep 27, 2022
5358bd9
Add attributes to data models
hyingyang-linkedin Oct 20, 2022
4b05e53
Added _scproxy necessary for MacOS (#651)
ahlag Sep 13, 2022
6d930ea
Add docs for consuming features in online environment (#609)
xiaoyongzhu Sep 14, 2022
fe478ab
Clean up after moving to LFAI (#665)
xiaoyongzhu Sep 14, 2022
cdbe3aa
Updating docker version in ARM template to use latest release tagged …
jainr Sep 14, 2022
1544999
Added prettier documentation (#672)
ahlag Sep 15, 2022
8497219
UI: Add data source detail page (#620)
ahlag Sep 15, 2022
e6c69da
Add aerospike sink (#632)
YihuiGuo Sep 19, 2022
739407d
Remove reference to aerospike in sbt (#680)
YihuiGuo Sep 19, 2022
f3a7206
Extend RBAC to support project id as input (#673)
Yuqing-cat Sep 19, 2022
7ccfd79
Local Spark Provider which supports to submit feature join job in loc…
Yuqing-cat Sep 20, 2022
dacda66
Fixing issue with docker image on demo apps not getting updated (#686)
jainr Sep 20, 2022
42c81a3
Lock python dependency versions (#690)
xiaoyongzhu Sep 21, 2022
d215f14
Apply 'aggregation_features' parameter to merge dataframes (#667)
enya-yx Sep 21, 2022
8830247
Fix data source detail page in rbac registry (#698)
Yuqing-cat Sep 22, 2022
9be7a59
Fix multi-keyed feature in anchor (direct purview) (#676)
YihuiGuo Sep 22, 2022
5fb8025
Fix path with #LATEST (#684)
jaymo001 Sep 23, 2022
a58e017
Fix Feature value adaptor and UDF adaptor on Spark executors (#660)
jaymo001 Sep 23, 2022
6a3e74a
Enhance SQL Registry Error Messages (#674)
windoze Sep 23, 2022
89835c3
bump version to 0.8.0 (#694)
Yuqing-cat Sep 23, 2022
930640f
Fix feature type bug where inferred feature type might not be honored…
jaymo001 Sep 23, 2022
41bc451
Update setup.py (#702)
xiaoyongzhu Sep 24, 2022
e300c55
fix rbac+purview web app issue (#700)
Yuqing-cat Sep 25, 2022
8d44482
Remove hard coded resources in docs (#696)
enya-yx Sep 25, 2022
5cccd84
Add e2e test for purview registry and rbac registry (#689)
blrchen Sep 26, 2022
cf3d1f5
Update test use runtime jar from maven for spark submission to cover …
blrchen Sep 26, 2022
d73a6ae
Enhance databricks submission error message (#710)
enya-yx Sep 27, 2022
943058c
Enhance purview registry error messages (#709)
blrchen Sep 28, 2022
8e63036
hot fix databricks es dependency issue (#713)
Yuqing-cat Sep 29, 2022
9603793
Fix materialize to sql e2e test failure (#717)
blrchen Sep 29, 2022
dca177c
Add Data Models in Feathr (#659)
hyingyang-linkedin Sep 29, 2022
ac6403f
Revert "Enhance purview registry error messages (#709)" (#720)
blrchen Sep 30, 2022
588484b
Improve Avro GenericRecord and SpecificRecord based row-level extract…
jaymo001 Oct 5, 2022
4a389cb
Save lookup feature definition to HOCON files (#732)
jaymo001 Oct 8, 2022
6a49796
Fix function string parsing (#725)
loomlike Oct 8, 2022
c3b0eb8
Apply a same credential within each sample (#718)
enya-yx Oct 10, 2022
15a02a9
Enable incremental for HDFS sink (#695)
enya-yx Oct 11, 2022
ce32b17
#492 fix, fail only if different sources have same name (#733)
windoze Oct 11, 2022
ecdf585
Remove unused credentials and deprecated purview settings (#708)
enya-yx Oct 12, 2022
54dfa85
Revoke token submitted by mistaken (#730)
blrchen Oct 12, 2022
529da26
Update product_recommendation_demo.ipynb
hangfei Oct 12, 2022
9d5b98d
Fix synapse errors not print out issue (#734)
enya-yx Oct 12, 2022
08a3090
Spark config passing bug fix for local spark submission (#729)
loomlike Oct 12, 2022
1c5a31e
Fix direct purview client missing transformation (#736)
YihuiGuo Oct 13, 2022
aa2f4cf
Revert "Derived feature bugfix (#121)" (#731)
jaymo001 Oct 13, 2022
a136cf8
Support SWA with groupBy to 1d tensor conversion (#748)
jaymo001 Oct 13, 2022
df64835
Rijai/armfix (#742)
jainr Oct 14, 2022
30a7b86
bump version to 0.8.2 (#722)
Yuqing-cat Oct 14, 2022
0c9bba0
Added latest deltalake version (#735)
ahlag Oct 14, 2022
77f93f7
#474 Disable local mode (#738)
windoze Oct 15, 2022
0760299
Allow recreating entities for PurView registry (#691)
windoze Oct 15, 2022
0acb0f3
Adding DevSkim linter to Github actions (#657)
jainr Oct 17, 2022
b118159
Fix icons in UI cannot auto scale (#737) (#744)
Fendoe Oct 17, 2022
beb4588
Expose 'timePartitionPattern' in Python API [ WIP ] (#714)
enya-yx Oct 17, 2022
e93f9ca
Setting up component governance pipeline (#655)
jainr Oct 17, 2022
24e0b8b
Add docs to explain on feature materialization behavior (#688)
xiaoyongzhu Oct 18, 2022
38fd0cd
Fix protobuf version (#711)
enya-yx Oct 18, 2022
da52af6
Add some notes based on on-call issues (#753)
enya-yx Oct 18, 2022
6cb3447
Refine spark runtime error message (#755)
Yuqing-cat Oct 19, 2022
3ef64cf
Serialization bug due to version incompatibility between azure-core a…
jainr Oct 19, 2022
d6c1958
Unify Python SDK Build Version and decouple Feathr Maven Version (#746)
Yuqing-cat Oct 19, 2022
ef973e5
replace hard code string in notebook and align with others (#765)
Yuqing-cat Oct 19, 2022
d711452
Add flag to enable generation non-agg features (#719)
windoze Oct 20, 2022
a041253
rollback 0.8.2 version bump PR (#771)
Yuqing-cat Oct 24, 2022
53af098
Refactor Product Recommendation sample notebook (#743)
jainr Oct 24, 2022
b24a7cd
Update role-management page in UI (#751) (#764)
Fendoe Oct 25, 2022
fb0fe85
Create Feature less module in UI code and import alias (#768)
Fendoe Oct 25, 2022
0d7fac7
Add dev and notebook dependencies. Add extra dependency installation …
loomlike Oct 25, 2022
88d495f
Fix Windows compatibility issues (#776)
xiaoyongzhu Oct 25, 2022
8ca3063
Update models.py
hyingyang-linkedin Sep 20, 2022
5007481
Update models.py
hyingyang-linkedin Sep 21, 2022
0cd2983
Merge remote-tracking branch 'upstream/main' into model
hyingyang-linkedin Oct 25, 2022
e45b800
Address comments
hyingyang-linkedin Oct 25, 2022
a4c8ff6
Remove sourceRef
hyingyang-linkedin Oct 31, 2022
b94b15e
Add functionType
hyingyang-linkedin Oct 31, 2022
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
Empty file.
137 changes: 137 additions & 0 deletions registry/data-models/common/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
from pydantic import BaseModel
from typing import Dict, Optional, List, Union
import json
from enum import Enum


class ValueType(Enum):
"""
Type of the feature.
"""
INT = "int"
LONG = "long"
FLOAT = "float"
DOUBLE = "double"
STRING = "string"
BOOLEAN = "boolean"
BYTES = "bytes"


class DimensionType(Enum):
"""
Supported dimension types for tensors in Feathr.
"""
INT = "int"
LONG = "long"
STRING = "string"
BOOLEAN = "boolean"
BYTES = "bytes"


class TensorCategory(Enum):
"""
Supported Tensor categories in Feathr.
"""
DENSE = "dense" # Dense tensors store values in a contiguous sequential block of memory where all values are represented.
SPARSE = "sparse" # Sparse tensor represents a dataset in which most of the entries are zero.
RAGGED = "ragged" # Ragged tensors (also known as nested tensors) are similar to dense tensors but have variable-length dimensions.


class FeatureValueType(Enum):
"""
The high level types associated with a feature.
This represents the high level semantic types supported by early versions of Frame.
"""
BOOLEAN = "boolean" # Boolean valued feature
NUMERIC = "numeric" # Numerically valued feature
CATEGORICAL = "categorical" # Represent a feature that consists of a single category
CATEGORICAL_SET = "categorical_set" # Represent a feature that consists of multiple categories
DENSE_VECTOR = "dense_vector" # Represent a feature in vector format where the majority of the elements are non-zero
TERM_VECTOR = "term_vector" # Represent features that has string terms and numeric value
TENSOR = "tensor" # Represent tensor based features.
UNSPECIFIED = "unspecified" # Placeholder for when no types are specified


class Dimension(BaseModel):
"""
Tensor is used to represent feature data. A tensor is a generalization of vectors and matrices to potentially higher dimensions.
"""
type: DimensionType # Type of the dimension in the tensor. Each dimension can have a different type.
shape: Optional[int] # Size of the dimension in the tensor. If unset, it means the size is unknown and actual size will be determined at runtime.


class TensorFeatureFormat(BaseModel):
"""
Defines the format of feature data. Feature data is produced by applying transformation on source, in a Feature.
Tensor is used to represent feature data. A tensor is a generalization of vectors and matrices to potentially
higher dimensions.
"""
tensorCategory: TensorCategory # Type of the tensor.
valueType: ValueType # Type of the value column.
dimensions: List[Dimension] # A feature data can have zero or more dimensions (columns that represent keys).


class FeatureType(BaseModel):
"""
Information about a featureName. It defines the type, format and default value.
Tensor is the next generation representation of the features, so using
Tensor type w TensorFeatureFormat would be preferable FeatureType.
"""
type: FeatureValueType # Defines the high level semantic type of feature.
format: Optional[TensorFeatureFormat] # Defines the format of feature data.
defaultValue: Union[bool, int, float, str, bytes]


class Clazz(BaseModel):
"""
Reference to a class by fully-qualified name
"""
fullyQualifiedName: str # A fully-qualified class name including paths.


class Function(BaseModel):
"""
Base model for all functions
"""
expression: str # Expression in str format
functionType: str # Type of function in str format, will be used in UI


class MvelExpression(Function):
"""
An expression in MVEL language.
"""
mvel: str # The MVEL expression
Comment thread
hyingyang-linkedin marked this conversation as resolved.


class UserDefinedFunction(Function):
Comment thread
LeBenHL marked this conversation as resolved.
"""
User defined function that can be used in feature extraction or derivation.
"""
clazz: Clazz # Reference to the class that implements the user defined function.
parameters: Dict[str, json] = {} # This field defines the custom parameters of the user defined function


class SparkSqlExpression(Function):
"""
An expression in Spark SQL.
"""
sql: str # Spark SQl expression
Comment thread
hyingyang-linkedin marked this conversation as resolved.


class SemanticVersion(BaseModel):
"""
A representation of a semantic version (see https://semver.org/)
"""
majorVersion: int # The major version of this version. This is the x in x.y.z.
minorVersion: int # The minor version of this version. This is the y in x.y.z
patchVersion: int # The patch version of this version. This is the z in x.y.z
metadata: Optional[str] # Optional build metadata attached to this version.


class FeathrModel(BaseModel):
"""
Base model for feathr entity which will be displayed in Feathr UI
"""
displayName: str # name of the entity showed on UI
typeName: str # type of entity in str format, will be displayed in UI
179 changes: 169 additions & 10 deletions registry/data-models/data-model-diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,194 @@ This file defines abstract backend data models diagram for feature registry.

```mermaid
classDiagram
Project "1" --> "n" FeatureName : contains
Project "1" --> "n" Anchor : contains
FeatureName "1" --> "n" Feature : contains
Anchor "1" --> "n" Feature : contains
Feature <|-- AnchorFeature : extends
Project "1" --> "n" FeatureName: contains
Project "1" --> "n" Anchor: contains
FeatureName "1" --> "n" Feature: contains
FeatureName --> "Optional" SemanticVersion: contains
FeatureName --> "Optional" FeatureType: contains
Anchor "1" --> "n" AnchorFeature: contains
Anchor --> DataSource: contains
Feature <|-- AnchorFeature: extends
Feature <|-- DerivedFeature: extends
Feature --> Transformation
Feature --> Transformation : contains
Feature --> Transformation: contains
Feature --> Source: contains
Transformation --> Function: contains
Source <|-- DataSource: extends
DataSource --> "Optional" Clazz: contains
DataSource --> "Optional" Function: contains
Source <|-- MultiFeatureSource: extends
MultiFeatureSource "1" --> "1..n" FeatureSource: contains
AnchorFeature --> DataSource : contains
AnchorFeature --> DataSource: contains
DerivedFeature --> MultiFeatureSource: contains

FeathrModel <|-- Project: extends
FeathrModel <|-- FeatureName: extends
FeathrModel <|-- Anchor: extends
FeathrModel <|-- Feature: extends
FeathrModel <|-- Source: extends
Dimension --> DimensionType: contains
TensorFeatureFormat --> TensorCategory: contains
TensorFeatureFormat --> ValueType: contains
TensorFeatureFormat "1" --> "1..n" Dimension: contains
FeatureType --> FeatureValueType: contains
FeatureType --> "Optional" TensorFeatureFormat: contains
Window --> WindowTimeUnit: contains
Function <|-- MvelExpression: extends
Function <|-- UserDefinedFunction: extends
Function <|-- SparkSqlExpression: extends
SlidingWindowAggregation --> SparkSqlExpression: contains
SlidingWindowAggregation --> SlidingWindowAggregationType: contains
SlidingWindowAggregation --> Window: contains
SlidingWindowEmbeddingAggregation --> SparkSqlExpression: contains
SlidingWindowEmbeddingAggregation --> SlidingWindowEmbeddingAggregationType: contains
SlidingWindowEmbeddingAggregation --> Window: contains
SlidingWindowLatestAvailable --> SparkSqlExpression: contains
SlidingWindowLatestAvailable --> Window: contains
Function <|-- SlidingWindowAggregation: extends
Function <|-- SlidingWindowEmbeddingAggregation: extends
Function <|-- SlidingWindowLatestAvailable: extends

class ValueType{
<<enumeration>>
INT
LONG
FLOAT
DOUBLE
STRING
BOOLEAN
BYTES
}
class DimensionType{
<<enumeration>>
INT
LONG
STRING
BOOLEAN
BYTES
}
class TensorCategory{
<<enumeration>>
DENSE
SPARSE
RAGGED
}
class FeatureValueType{
<<enumeration>>
BOOLEAN
NUMERIC
CATEGORICAL
CATEGORICAL_SET
DENSE_VECTOR
TERM_VECTOR
TENSOR
UNSPECIFIED
}
class Dimension{
+DimensionType type
+Optional[str] shape
}
class TensorFeatureFormat{
+TensorCategory tensorCategory
+ValueType valueType
+List[Dimension] dimensions
}
class FeatureType{
+FeatureValueType type
+Optional[TensorFeatureFormat] format
+Union[bool, int, float, str, types] defaultValue
}
class Clazz{
+str fullyQualifiedName
}
class Function{
+str expression
}
class MvelExpression{
+str mvel
}
class UserDefinedFunction{
+str sql
}
class SemanticVersion{
+int majorVersion
+int minorVersion
+int patchVersion
+Optional[str] metadata
}
class FeathrModel{
+str displayName
+str typeName
}
class SlidingWindowAggregationType{
<<enumeration>>
SUM
COUNT
MAX
MIN
AVG
}
class SlidingWindowEmbeddingAggregationType{
<<enumeration>>
MAX_POOLING
MIN_POOLING
AVG_POOLING
}
class WindowTimeUnit{
<<enumeration>>
DAY
HOUR
MINUTE
SECOND
}
class Window{
+int size
+WindowTimeUnit unit
}
class SlidingWindowAggregation{
+SlidingWindowAggregationType aggregationType
+Window window
+SparkSqlExpression targetColumn
+Optional[SparkSqlExpression] filter
+Optional[SparkSqlExpression] groupBy
+Optional[int] limit
}
class SlidingWindowEmbeddingAggregation{
+SlidingWindowEmbeddingAggregationType aggregationType
+Window window
+SparkSqlExpression targetColumn
+Optional[SparkSqlExpression] filter
+Optional[SparkSqlExpression] groupBy
}
class SlidingWindowLatestAvailable{
+Optional[Window] window
+SparkSqlExpression targetColumn
+Optional[SparkSqlExpression] filter
+Optional[SparkSqlExpression] groupBy
+Optional[int] limit
}
class Source{
}
class DataSource{
+Optional[Clazz] clazz
+Optional[Function] keyFunction
}
class FeatureSource{
+FeatureNameId feature_name_id
+FeatureNameId input_feature_name_id
+Optional[str] alias
}
class MultiFeatureSource{
+List[FeatureSource] sources
}
class Transformation{
+Function transformationFunction
}
class Feature{
+FeatureId id
+FeatureNameId feature_namme_id
+Source source
+Transformation transformation
}
class AnchorFeature{
+AnchorId anchor_id
+DataSource source
}
class DerivedFeature{
Expand All @@ -46,6 +203,8 @@ classDiagram
+FeatureNameId id
+ProjectId project_id
+List[FeatureId] feature_ids
+Optional[SemanticVersion] semanticVersion
+Optional[FeatureType] featureType
}
class Project{
+ProjectId id
Expand Down
Loading