Skip to content

Commit 8460083

Browse files
Merge branch 'dev' into support-for-Weaviate
2 parents 9c90089 + 2852a41 commit 8460083

17 files changed

+586
-84
lines changed

.github/workflows/Nightly_CI_main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/checkout@main
3737

3838
- name: Set up Python 3.8
39-
uses: actions/setup-python@v2
39+
uses: actions/setup-python@v4
4040
with:
4141
python-version: 3.8
4242
cache: pip

.github/workflows/build_dev_python_package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@master
3030
- name: Setup Python
31-
uses: actions/setup-python@v2.3.1
31+
uses: actions/setup-python@v4
3232
with:
3333
python-version: 3.8
3434
# - name: Get history and tags for SCM versioning

.github/workflows/publish_dev_package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@master
3636
- name: Setup Python
37-
uses: actions/setup-python@v2.3.1
37+
uses: actions/setup-python@v4
3838
with:
3939
python-version: 3.8
4040
# - name: Get history and tags for SCM versioning

.github/workflows/publish_release_package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@master
3030
- name: Setup Python
31-
uses: actions/setup-python@v2.3.1
31+
uses: actions/setup-python@v4
3232
with:
3333
python-version: 3.8
3434
# - name: Get history and tags for SCM versioning

.github/workflows/pylint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v3.0.0
3434
- name: Setup Python
35-
uses: actions/setup-python@v3.0.0
35+
uses: actions/setup-python@v4
3636
with:
3737
python-version: 3.8
3838
- name: Python pylint

.github/workflows/unit_test_main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@main
4949

5050
- name: Set up Python 3.8
51-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v4
5252
with:
5353
python-version: 3.8
5454
cache: pip

gptcache/manager/scalar_data/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def get_ids(self, deleted=True):
120120
pass
121121

122122
@abstractmethod
123-
def count(self):
123+
def count(self, state: int = 0, is_all: bool = False):
124124
pass
125125

126126
def flush(self):

gptcache/manager/scalar_data/manager.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ def get(name, **kwargs):
9393
username=kwargs.get("username"),
9494
password=kwargs.get("password")
9595
)
96+
elif name == "redis":
97+
from gptcache.manager.scalar_data.redis_storage import RedisCacheStorage
98+
99+
return RedisCacheStorage(
100+
host=kwargs.pop("redis_host", "localhost"),
101+
port=kwargs.pop("redis_port", 6379),
102+
global_key_prefix=kwargs.pop("global_key_prefix", TABLE_NAME),
103+
**kwargs
104+
)
96105
else:
97106
raise NotFoundError("cache store", name)
98107
return cache_base

gptcache/manager/scalar_data/mongo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
import_mongodb()
1010

11-
from mongoengine import Document # pylint: disable=wrong-import-position
12-
from mongoengine import fields # pylint: disable=wrong-import-position
13-
import mongoengine as me # pylint: disable=wrong-import-position
11+
# pylint: disable=C0413
12+
from mongoengine import Document
13+
from mongoengine import fields
14+
import mongoengine as me
1415

1516

1617
def get_models():
@@ -253,7 +254,7 @@ def list_sessions(self, session_id=None, key=None):
253254
if session_id:
254255
query["session_id"] = session_id
255256
if key:
256-
query["_id"] = key
257+
query["question_id"] = key
257258

258259
return self._session.objects(__raw__=query)
259260

0 commit comments

Comments
 (0)