Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
fix: update python-arango dependency and use default HTTP client, #11
Browse files Browse the repository at this point in the history
  • Loading branch information
tangram committed Oct 17, 2023
1 parent b8c0026 commit 002ace0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
28 changes: 1 addition & 27 deletions migrado/db_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,8 @@

from arango import ArangoClient
from arango.exceptions import TransactionExecuteError
from arango.http import DefaultHTTPClient
from arango.response import Response


class HTTPClient(DefaultHTTPClient):
def __init__(self, timeout):
self.timeout = timeout

def send_request(self, session, method, url, params=None, data=None, headers=None, auth=None):
response = session.request(
method=method,
url=url,
params=params,
data=data,
headers=headers,
auth=auth,
timeout=self.timeout
)
return Response(
method=response.request.method,
url=response.url,
headers=response.headers,
status_code=response.status_code,
status_text=response.reason,
raw_body=response.text,
)

class MigrationClient:
"""Client for reading and writing state, running migrations against ArangoDB"""

Expand All @@ -49,8 +24,7 @@ def __init__(self, tls, host, port, username, password, db, coll, timeout=1200):
self.coll_name = coll
self.timeout = timeout

http_client = HTTPClient(timeout=timeout)
self.db_client = ArangoClient(f'{self.protocol}://{host}:{port}', http_client=http_client)
self.db_client = ArangoClient(f'{self.protocol}://{host}:{port}', request_timeout=timeout)

@property
def db(self):
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "migrado"
version = "0.6.8"
version = "0.6.9"
description = "ArangoDB migrations and batch processing manager"
authors = ["Eirik Krogstad <eirikkr@gmail.com>"]
license = "MIT"
Expand All @@ -10,7 +10,7 @@ repository = "https://github.com/protojour/migrado"
[tool.poetry.dependencies]
python = "^3.8"
click = "^8.1.3"
python-arango = "^7.1.0"
python-arango = "^7.7.0"
pyyaml = "^6.0.1"
rich = "^10.12.0"

Expand Down

0 comments on commit 002ace0

Please sign in to comment.