Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
21e47d2
test
mavysavydav Jun 12, 2021
06e0c77
refactored existing tests to test full_feature_names feature on data …
Mwad22 Jun 16, 2021
4b7dd18
removed full_feature_names usage from quickstart and README to have m…
Mwad22 Jun 16, 2021
579e08f
Update CHANGELOG for Feast v0.10.8
Jun 17, 2021
462da43
GitBook: [master] 2 pages modified
achals Jun 17, 2021
df95ee8
Schema Inferencing should happen at apply time (#1646)
mavysavydav Jun 18, 2021
e383575
GitBook: [master] 80 pages modified
woop Jun 19, 2021
dd25ad6
GitBook: [master] 80 pages modified
woop Jun 20, 2021
cef2869
Provide descriptive error on invalid table reference (#1627)
codyjlin Jun 21, 2021
c2e2b4d
Refactor OnlineStoreConfig classes into owning modules (#1649)
achals Jun 21, 2021
d2cda24
Possibility to specify a project for BigQuery queries (#1656)
MattDelac Jun 21, 2021
4ab4c60
Refactor OfflineStoreConfig classes into their owning modules (#1657)
achals Jun 22, 2021
64a2cb5
Run python unit tests in parallel (#1652)
achals Jun 22, 2021
9e4c907
Rename telemetry to usage (#1660)
Jun 22, 2021
b951282
resolved final comments on PR (variable renaming, refactor tests)
Mwad22 Jun 23, 2021
a68b12b
reformatted after merge conflict
Mwad22 Jun 23, 2021
094dbf3
Update CHANGELOG for Feast v0.11.0
woop Jun 24, 2021
0a148f9
Update charts README (#1659)
szalai1 Jun 25, 2021
0ce8210
Added Redis to list of online stores for local provider in providers …
nels Jun 25, 2021
d71e4c5
Grouped inferencing statements together in apply methods for easier r…
mavysavydav Jun 25, 2021
c14023f
Add RedshiftDataSource (#1669)
Jun 28, 2021
d138648
Provide the user with more options for setting the to_bigquery config…
codyjlin Jun 28, 2021
c02b9eb
Add streaming sources to the FeatureView API (#1664)
achals Jun 28, 2021
12dbbea
Add to_table() to RetrievalJob object (#1663)
MattDelac Jun 29, 2021
d0fe0a9
Rename to_table to to_arrow (#1671)
MattDelac Jun 29, 2021
6e8670e
Cancel BigQuery job if timeout hits (#1672)
MattDelac Jun 29, 2021
5314024
Fix Feature References example (#1674)
GregKuhlmann Jun 30, 2021
eb1da5e
Allow strings for online/offline store instead of dicts (#1673)
achals Jun 30, 2021
183a0b9
Remove default list from the FeatureView constructor (#1679)
achals Jul 1, 2021
b714a12
made changes requested by @tsotnet
Mwad22 Jul 2, 2021
c78894f
Fix unit tests that got broken by Pandas 1.3.0 release (#1683)
Jul 3, 2021
20c9461
Add support for DynamoDB and S3 registry (#1483)
leonid133 Jul 3, 2021
d36d1a0
Parallelize integration tests (#1684)
Jul 4, 2021
651bce3
BQ exception should be raised first before we check the timedout (#1675)
MattDelac Jul 5, 2021
f3b92c3
Update sdk/python/feast/infra/provider.py
Mwad22 Jul 5, 2021
f400d65
Update sdk/python/feast/feature_store.py
Mwad22 Jul 5, 2021
082fca7
made error logic/messages more descriptive
Mwad22 Jul 5, 2021
3aca976
made error logic/messages more descriptive.
Mwad22 Jul 5, 2021
79aa736
Simplified error messages
Mwad22 Jul 6, 2021
d7d08ef
ran formatter, issue in errors.py
Mwad22 Jul 7, 2021
2ab8eea
Merge branch 'master' into mwad22-1618-PR
Mwad22 Jul 7, 2021
650340d
python linter issues resolved
Mwad22 Jul 7, 2021
5d582a6
removed unnecessary default assignment in get_historical_features. de…
Mwad22 Jul 8, 2021
8724e0b
added error message assertion for feature name collisions, and other …
Mwad22 Jul 8, 2021
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
Provide descriptive error on invalid table reference (#1627)
* Initial commit to catch nonexistent table

Signed-off-by: Cody Lin <codyjlin@yahoo.com>
Signed-off-by: Cody Lin <codyl@twitter.com>

* simplify nonexistent BQ table test

Signed-off-by: Cody Lin <codyl@twitter.com>

* clean up table_exists exception

Signed-off-by: Cody Lin <codyl@twitter.com>

* remove unneeded variable

Signed-off-by: Cody Lin <codyl@twitter.com>

* function name change to _assert_table_exists

Signed-off-by: Cody Lin <codyl@twitter.com>

* Initial commit to catch nonexistent table

Signed-off-by: Cody Lin <codyjlin@yahoo.com>
Signed-off-by: Cody Lin <codyl@twitter.com>

* simplify nonexistent BQ table test

Signed-off-by: Cody Lin <codyl@twitter.com>

* clean up table_exists exception

Signed-off-by: Cody Lin <codyl@twitter.com>

* function name change to _assert_table_exists

Signed-off-by: Cody Lin <codyl@twitter.com>

* fix lint errors and rebase

Signed-off-by: Cody Lin <codyl@twitter.com>

* Fix get_table(None) error

Signed-off-by: Cody Lin <codyl@twitter.com>

* custom exception for both missing file and BQ source

Signed-off-by: Cody Lin <codyl@twitter.com>

* revert FileSource checks

Signed-off-by: Cody Lin <codyl@twitter.com>

* Use DataSourceNotFoundException instead of subclassing

Signed-off-by: Cody Lin <codyl@twitter.com>

* Moved assert_table_exists out of the BQ constructor to apply_total

Signed-off-by: Cody Lin <codyl@twitter.com>

* rename test and test asset

Signed-off-by: Cody Lin <codyl@twitter.com>

* move validate logic back to data_source

Signed-off-by: Cody Lin <codyl@twitter.com>

* fixed tests

Signed-off-by: Cody Lin <codyl@twitter.com>

* Set pytest.integration for tests that access BQ

Signed-off-by: Cody Lin <codyl@twitter.com>

* Import pytest in failed test files

Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Mwad22 <51929507+Mwad22@users.noreply.github.com>
  • Loading branch information
codyjlin authored and Mwad22 committed Jul 7, 2021
commit cef286952aaedb21716a91121ebc3f988f0e3326
22 changes: 22 additions & 0 deletions sdk/python/feast/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from feast import type_map
from feast.data_format import FileFormat, StreamFormat
from feast.errors import DataSourceNotFoundException
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto
from feast.value_type import ValueType

Expand Down Expand Up @@ -519,6 +520,12 @@ def to_proto(self) -> DataSourceProto:
"""
raise NotImplementedError

def validate(self):
"""
Validates the underlying data source.
"""
raise NotImplementedError


class FileSource(DataSource):
def __init__(
Expand Down Expand Up @@ -615,6 +622,10 @@ def to_proto(self) -> DataSourceProto:

return data_source_proto

def validate(self):
# TODO: validate a FileSource
pass

@staticmethod
def source_datatype_to_feast_value_type() -> Callable[[str], ValueType]:
return type_map.pa_to_feast_value_type
Expand Down Expand Up @@ -692,6 +703,17 @@ def to_proto(self) -> DataSourceProto:

return data_source_proto

def validate(self):
if not self.query:
from google.api_core.exceptions import NotFound
from google.cloud import bigquery

client = bigquery.Client()
try:
client.get_table(self.table_ref)
except NotFound:
raise DataSourceNotFoundException(self.table_ref)

def get_table_query_string(self) -> str:
"""Returns a string that can directly be used to reference this table in SQL"""
if self.table_ref:
Expand Down
7 changes: 7 additions & 0 deletions sdk/python/feast/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
from colorama import Fore, Style


class DataSourceNotFoundException(Exception):
def __init__(self, path):
super().__init__(
f"Unable to find table at '{path}'. Please check that table exists."
)


class FeastObjectNotFoundException(Exception):
pass

Expand Down
3 changes: 2 additions & 1 deletion sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ def apply_total(repo_config: RepoConfig, repo_path: Path):

data_sources = [t.input for t in repo.feature_views]

# Make sure the data source used by this feature view is supported by
# Make sure the data source used by this feature view is supported by Feast
for data_source in data_sources:
assert_offline_store_supports_data_source(
repo_config.offline_store, data_source
)
data_source.validate()

update_data_sources_with_inferred_event_timestamp_col(data_sources)
for view in repo.feature_views:
Expand Down
20 changes: 20 additions & 0 deletions sdk/python/tests/example_feature_repo_with_missing_bq_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from datetime import timedelta

from feast import BigQuerySource, Entity, Feature, FeatureView, ValueType

nonexistent_source = BigQuerySource(
table_ref="project.dataset.nonexistent_table", event_timestamp_column=""
)

driver = Entity(name="driver", value_type=ValueType.INT64, description="driver id",)

nonexistent_features = FeatureView(
name="driver_locations",
entities=["driver"],
ttl=timedelta(days=1),
features=[
Feature(name="lat", dtype=ValueType.FLOAT),
Feature(name="lon", dtype=ValueType.STRING),
],
input=nonexistent_source,
)
35 changes: 35 additions & 0 deletions sdk/python/tests/test_cli_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,38 @@ def test_basic() -> None:

result = runner.run(["teardown"], cwd=repo_path)
assert result.returncode == 0


@pytest.mark.integration
def test_missing_bq_source_fail() -> None:
project_id = "".join(
random.choice(string.ascii_lowercase + string.digits) for _ in range(10)
)
runner = CliRunner()
with tempfile.TemporaryDirectory() as repo_dir_name, tempfile.TemporaryDirectory() as data_dir_name:

repo_path = Path(repo_dir_name)
data_path = Path(data_dir_name)

repo_config = repo_path / "feature_store.yaml"

repo_config.write_text(
dedent(
f"""
project: {project_id}
registry: {data_path / "registry.db"}
provider: gcp
"""
)
)

repo_example = repo_path / "example.py"
repo_example.write_text(
(
Path(__file__).parent / "example_feature_repo_with_missing_bq_source.py"
).read_text()
)

returncode, output = runner.run_with_output(["apply"], cwd=repo_path)
assert returncode == 1
assert b"DataSourceNotFoundException" in output
3 changes: 3 additions & 0 deletions sdk/python/tests/test_cli_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
from textwrap import dedent

import assertpy
import pytest

from feast.feature_store import FeatureStore
from tests.cli_utils import CliRunner
from tests.online_read_write_test import basic_rw_test


@pytest.mark.integration
def test_workflow() -> None:
"""
Test running apply on a sample repo, and make sure the infra gets created.
Expand Down Expand Up @@ -78,6 +80,7 @@ def test_workflow() -> None:
assertpy.assert_that(result.returncode).is_equal_to(0)


@pytest.mark.integration
def test_non_local_feature_repo() -> None:
"""
Test running apply on a sample repo, and make sure the infra gets created.
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/tests/test_online_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from tests.cli_utils import CliRunner, get_example_repo


@pytest.mark.integration
def test_online() -> None:
"""
Test reading from the online store in local mode.
Expand Down Expand Up @@ -247,6 +248,7 @@ def test_online() -> None:
os.rename(store.config.registry + "_fake", store.config.registry)


@pytest.mark.integration
def test_online_to_df():
"""
Test dataframe conversion. Make sure the response columns and rows are
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/tests/test_partial_apply.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pytest
from google.protobuf.duration_pb2 import Duration

from feast import BigQuerySource, Feature, FeatureView, ValueType
from tests.cli_utils import CliRunner, get_example_repo
from tests.online_read_write_test import basic_rw_test


@pytest.mark.integration
def test_partial() -> None:
"""
Add another table to existing repo using partial apply API. Make sure both the table
Expand Down