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

fix: Update sql.py #3096

Merged
merged 4 commits into from
Aug 17, 2022
Merged
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
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def _apply_object(
):
self._maybe_init_project_metadata(project)

name = name or obj.name if hasattr(obj, "name") else None
name = name or (obj.name if hasattr(obj, "name") else None)
assert name, f"name needs to be provided for {obj}"

with self.engine.connect() as conn:
Expand Down
22 changes: 22 additions & 0 deletions sdk/python/tests/unit/test_sql_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,25 @@ def test_apply_data_source(sql_registry):
assert registry_batch_source == batch_source

sql_registry.teardown()


@pytest.mark.skipif(
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
reason="does not run on mac github actions",
)
@pytest.mark.parametrize(
"sql_registry",
[
lazy_fixture("mysql_registry"),
lazy_fixture("pg_registry"),
lazy_fixture("sqlite_registry"),
],
)
def test_update_infra(sql_registry):
# Create infra object
project = "project"
infra = sql_registry.get_infra(project=project)

# Should run update infra successfully
sql_registry.update_infra(infra, project)
sql_registry.teardown()