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

feat: Create stream and batch feature view abstractions #2559

Merged
merged 3 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
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
Next Next commit
CR
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals committed Apr 18, 2022
commit 2f01c0ed858404d37d6d6468307c3067083a6735
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ The services with containerized replacements currently implemented are:
- Datastore
- DynamoDB
- Redis
- Trino

You can run `make test-python-integration-container` to run tests against the containerized versions of dependencies.

Expand Down
9 changes: 3 additions & 6 deletions sdk/python/feast/batch_feature_view.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from datetime import timedelta
from typing import Dict, List, Optional, Union

from google.protobuf.duration_pb2 import Duration

from feast import Entity, Feature, Field
from feast.data_source import DataSource
from feast.entity import Entity
from feast.feature_view import FeatureView
from feast.field import Field
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto

SUPPORTED_BATCH_SOURCES = {
Expand All @@ -24,8 +23,7 @@ def __init__(
*,
achals marked this conversation as resolved.
Show resolved Hide resolved
name: Optional[str] = None,
entities: Optional[Union[List[Entity], List[str]]] = None,
ttl: Optional[Union[Duration, timedelta]] = None,
features: Optional[List[Feature]] = None,
ttl: Optional[timedelta] = None,
tags: Optional[Dict[str, str]] = None,
online: bool = True,
description: str = "",
Expand All @@ -51,7 +49,6 @@ def __init__(
ttl=ttl,
batch_source=None,
stream_source=None,
features=features,
tags=tags,
online=online,
description=description,
Expand Down
9 changes: 3 additions & 6 deletions sdk/python/feast/stream_feature_view.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from datetime import timedelta
from typing import Dict, List, Optional, Union

from google.protobuf.duration_pb2 import Duration

from feast import Entity, Feature, Field
from feast.data_source import DataSource
from feast.entity import Entity
from feast.feature_view import FeatureView
from feast.field import Field
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto

SUPPORTED_STREAM_SOURCES = {
Expand All @@ -20,8 +19,7 @@ def __init__(
*,
name: Optional[str] = None,
entities: Optional[Union[List[Entity], List[str]]] = None,
ttl: Optional[Union[Duration, timedelta]] = None,
features: Optional[List[Feature]] = None,
ttl: Optional[timedelta] = None,
tags: Optional[Dict[str, str]] = None,
online: bool = True,
description: str = "",
Expand All @@ -47,7 +45,6 @@ def __init__(
ttl=ttl,
batch_source=None,
stream_source=None,
features=features,
tags=tags,
online=online,
description=description,
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/unit/test_feature_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pytest

from feast import KafkaSource
from feast.batch_feature_view import BatchFeatureView
from feast.data_format import AvroFormat
from feast.data_source import KafkaSource
from feast.infra.offline_stores.file_source import FileSource
from feast.stream_feature_view import StreamFeatureView

Expand Down