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

Make CLI apply in local mode idempotent #1401

Merged
merged 1 commit into from
Mar 21, 2021
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/local_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def update_infra(
f"CREATE TABLE IF NOT EXISTS {_table_id(project, table)} (entity_key BLOB, feature_name TEXT, value BLOB, event_ts timestamp, created_ts timestamp, PRIMARY KEY(entity_key, feature_name))"
)
conn.execute(
f"CREATE INDEX {_table_id(project, table)}_ek ON {_table_id(project, table)} (entity_key);"
f"CREATE INDEX IF NOT EXISTS {_table_id(project, table)}_ek ON {_table_id(project, table)} (entity_key);"
)

for table in tables_to_delete:
Expand Down
4 changes: 4 additions & 0 deletions sdk/python/tests/cli/test_cli_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def test_basic(self) -> None:
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

# Doing another apply should be a no op, and should not cause errors
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

basic_rw_test(repo_path, "foo")

result = runner.run(["teardown", str(repo_path)], cwd=repo_path)
Expand Down
4 changes: 4 additions & 0 deletions sdk/python/tests/cli/test_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def test_basic(self) -> None:
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

# Doing another apply should be a no op, and should not cause errors
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

basic_rw_test(repo_path, project_name=self._project_id)

result = runner.run(["teardown", str(repo_path)], cwd=repo_path)
Expand Down