Skip to content
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
11 changes: 9 additions & 2 deletions aperturedb/ConnectorRest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@

from types import SimpleNamespace
from typing import Optional
try:
import pybase64 as base64
except ImportError:
import base64

from aperturedb.Connector import Connector
from aperturedb.Configuration import Configuration
from requests.adapters import HTTPAdapter
Expand Down Expand Up @@ -164,8 +169,10 @@ def _query(self, query, blob_array = [], try_resume=True):
verify = self.config.use_ssl and self.config.verify_hostname)
if response.status_code == 200:
# Parse response:
json_response = json.loads(response.text)
import base64
if hasattr(response, "json"):
json_response = response.json()
else:
json_response = json.loads(response.text)
response_blob_array = [base64.b64decode(
b) for b in json_response['blobs']]
self.last_response = json_response["json"]
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ aperturedb = "aperturedb"
"Bug Reports" = "https://github.com/aperture-data/aperturedb-python/issues"

[project.optional-dependencies]
speedups = [
"pybase64",
]
# This is used when we build the docker image for notebook
notebook = [
"torch",
Expand Down
Loading