Skip to content

Commit

Permalink
Fix error returned by delete operation (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtopper committed Jan 24, 2024
1 parent 5490b8f commit 31d5258
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 31d5258

Please sign in to comment.