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 error returned by delete operation #663

Merged
merged 1 commit into from
Jan 24, 2024
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
6 changes: 6 additions & 0 deletions clients/py/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import v3io_frames as v3f
from datetime import datetime
import pytz

from conftest import has_go, test_backends, protocols, has_session
from v3io_frames import DeleteError

tsdb_span = 5 # hours
integ_params = [(p, b) for p in protocols for b in test_backends]
Expand Down Expand Up @@ -220,6 +222,10 @@ def test_kv_read_empty_df(framesd, session, protocol):

client.delete(backend, tableName)

# calling delete again should raise an error
with pytest.raises(DeleteError):
client.delete(backend, tableName)


@pytest.mark.skipif(not has_session, reason='No session found')
@pytest.mark.skipif(not has_go, reason='Go SDK not found')
Expand Down
2 changes: 1 addition & 1 deletion clients/py/v3io_frames/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _delete(self, backend, table, filter, start, end, if_missing, metrics):
# TODO: Make it DELETE ?
resp = self._session.post(url, headers=headers, json=request)
if not resp.ok:
raise CreateError(resp.text)
raise DeleteError(resp.text)

@connection_error(ExecuteError)
def _execute(self, backend, table, command, args, expression):
Expand Down