Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added typecheck for the registry tags #282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion feathr_project/feathr/anchor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def __init__(self,
self.name = name
self.features = features
self.source = source
self.registry_tags=registry_tags
# adding typecheck for registry tags incase user could also do like this {"description", "this is a test feature"} as well as like this dictionary format {"description":"this is a test feature"}
self.registry_tags=registry_tags if isinstance(registry_tags,Dict) else dict([registry_tags])
self.validate_features()

def validate_features(self):
Expand Down
3 changes: 2 additions & 1 deletion feathr_project/feathr/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(self,
FeatureBase.validate_feature_name(name)
self.name = name
self.feature_type = feature_type
self.registry_tags=registry_tags
# adding typecheck for registry tags incase user could also do like this {"description", "this is a test feature"} as well as like this dictionary format {"description":"this is a test feature"}
self.registry_tags=registry_tags if isinstance(registry_tags,Dict) else dict([registry_tags])
self.key = key if isinstance(key, List) else [key]
# feature_alias: Rename the derived feature to `feature_alias`. Default to feature name.
self.feature_alias = name
Expand Down
3 changes: 2 additions & 1 deletion feathr_project/feathr/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def __init__(self,
self.name = name
self.event_timestamp_column = event_timestamp_column
self.timestamp_format = timestamp_format
self.registry_tags = registry_tags
# adding typecheck for registry tags incase user could also do like this {"description", "this is a test feature"} as well as like this dictionary format {"description":"this is a test feature"}
self.registry_tags=registry_tags if isinstance(registry_tags,Dict) else dict([registry_tags])

def __eq__(self, other):
"""A source is equal to another if name is equal."""
Expand Down