Skip to content
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
6 changes: 2 additions & 4 deletions .kokoro/presubmit/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Run all sessions except system tests and docs builds
# This only runs unit tests for Python 3.10 since unit tests are required for `cover` to run
# Other Python version unit tests are run separately
# Run fast linting and code formatting checks
env_vars: {
key: "NOX_SESSION"
value: "unit-3.10 lint lint_setup_py blacken cover"
value: "lint lint_setup_py blacken"
}

# Run unit tests in parallel, splitting up by file
Expand Down
5 changes: 0 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ def default(session):
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=google",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
"--ignore=tests/unit/vertex_ray",
"--ignore=tests/unit/vertex_adk",
"--ignore=tests/unit/vertex_langchain",
Expand Down
7 changes: 2 additions & 5 deletions tests/unit/vertexai/test_offline_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from google import auth
from vertexai.resources.preview.feature_store import (
offline_store,
FeatureGroup,
Feature,
)

pytestmark = [
Expand Down Expand Up @@ -266,7 +264,7 @@ def mock_session(bigframes_import_mock):

@pytest.fixture()
def mock_fg():
with mock.patch.object(FeatureGroup, "__new__") as mock_fg:
with mock.patch.object(offline_store, "FeatureGroup") as mock_fg:
yield mock_fg


Expand All @@ -284,7 +282,7 @@ def create_mock_fg(

@pytest.fixture()
def mock_feature():
with mock.patch.object(Feature, "__new__") as mock_feature:
with mock.patch.object(offline_store, "Feature") as mock_feature:
yield mock_feature


Expand Down Expand Up @@ -507,7 +505,6 @@ def test_one_feature_with_explicit_credentials(
# Ensure when getting the FeatureGroup and Feature, the credentials are
# passed through.
mock_fg.assert_called_once_with(
FeatureGroup,
"fake",
project=None,
credentials=credentials,
Expand Down
8 changes: 4 additions & 4 deletions vertexai/resources/preview/feature_store/offline_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ def fetch_historical_feature_values(

feature_data: List[impl.DataSource] = []
for feature in features:
if isinstance(feature, Feature):
feature_group = _get_feature_group_from_feature(feature, credentials)
feature_data.append(_feature_to_data_source(feature_group, feature))
elif isinstance(feature, str):
if isinstance(feature, str):
feature_group, feature = _extract_feature_from_str_repr(
feature, credentials
)
feature_data.append(_feature_to_data_source(feature_group, feature))
elif isinstance(feature, Feature):
feature_group = _get_feature_group_from_feature(feature, credentials)
feature_data.append(_feature_to_data_source(feature_group, feature))
else:
raise ValueError(
f"Unsupported feature type {type(feature)} found in feature list. Feature: {feature}"
Expand Down
Loading