Skip to content

Commit 84aef2d

Browse files
authored
ci: add 3.11 (#906)
πŸ‘‹ Thanks for submitting a Pull Request to EvaDB! πŸ™Œ We want to make contributing to EvaDB as easy and transparent as possible. Here are a few tips to get you started: - πŸ” Search existing EvaDB [PRs](https://github.com/georgia-tech-db/eva/pulls) to see if a similar PR already exists. - πŸ”— Link this PR to a EvaDB [issue](https://github.com/georgia-tech-db/eva/issues) to help us understand what bug fix or feature is being implemented. - πŸ“ˆ Provide before and after profiling results to help us quantify the improvement your PR provides (if applicable). πŸ‘‰ Please see our βœ… [Contributing Guide](https://evadb.readthedocs.io/en/stable/source/contribute/index.html) for more details.
1 parent 3f12cbd commit 84aef2d

File tree

6 files changed

+96
-32
lines changed

6 files changed

+96
-32
lines changed

β€Ž.circleci/config.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ workflows:
3232
v: "3.10"
3333
mode: "TEST"
3434
ray: "DISABLED"
35-
#- Linux:
36-
# name: "Test | v3.11 | Linux"
37-
# v: "3.11"
38-
# mode: "TEST"
39-
# ray: "DISABLED"
35+
- Linux:
36+
name: "Test | v3.11 | Linux"
37+
v: "3.11"
38+
mode: "TEST"
39+
ray: "DISABLED"
4040
- Linux:
4141
name: "Test | Ray | v3.8 | Linux"
4242
v: "3.8"
@@ -78,11 +78,11 @@ workflows:
7878
v: "3.10"
7979
mode: "NOTEBOOK"
8080
ray: "DISABLED"
81-
#- Linux:
82-
# name: "Notebook | v3.11 | Linux"
83-
# v: "3.11"
84-
# mode: "NOTEBOOK"
85-
# ray: "DISABLED"
81+
- Linux:
82+
name: "Notebook | v3.11 | Linux"
83+
v: "3.11"
84+
mode: "NOTEBOOK"
85+
ray: "DISABLED"
8686
- Linux:
8787
name: "Notebook | Ray | v3.8 | Linux"
8888
v: "3.8"
@@ -169,6 +169,18 @@ jobs:
169169
source test_evadb/bin/activate
170170
python -c "import yaml;f = open('evadb/evadb.yml', 'r+');config_obj = yaml.load(f, Loader=yaml.FullLoader);config_obj['experimental']['ray'] = True;f.seek(0);f.write(yaml.dump(config_obj));f.truncate();"
171171
pip install ".[ray]"
172+
173+
# Install qdrant only on versions < 3.11
174+
- when:
175+
condition:
176+
not:
177+
equal: [ "3.11", << parameters.v >> ]
178+
steps:
179+
- run:
180+
name: Install Qdrant
181+
command: |
182+
source test_evadb/bin/activate
183+
pip install ".[qdrant]"
172184
173185
- run:
174186
name: Test and upload coverage report to coveralls

β€Žscript/test/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ then
7676
# Non-Windows
7777
if [[ "$OSTYPE" != "msys" ]];
7878
then
79-
PYTHONPATH=./ pytest --durations=20 --cov-report term-missing:skip-covered --cov-config=.coveragerc --cov-context=test --cov=evadb/ --capture=sys --tb=short -v -rsf --log-level=WARNING -m "not benchmark"
79+
PYTHONPATH=./ pytest test/ --durations=20 --cov-report term-missing:skip-covered --cov-config=.coveragerc --cov-context=test --cov=evadb/ --capture=sys --tb=short -v -rsf --log-level=WARNING -m "not benchmark"
8080
test_code=$?
8181
if [ "$test_code" != "0" ];
8282
then

β€Žsetup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def read(path, encoding="utf-8"):
8787
"thefuzz", # FUZZY STRING MATCHING
8888
"pytube", # YOUTUBE QA APP
8989
"youtube-transcript-api", # YOUTUBE QA APP
90-
"qdrant-client>=1.1.7", # QDRANT VECTOR STORE
9190
"boto3", # AWS
9291
"norfair>=2.2.0", # OBJECT TRACKING
9392
"kornia", # SIFT FEATURES
@@ -105,6 +104,10 @@ def read(path, encoding="utf-8"):
105104
"nest-asyncio>=1.5.6",
106105
]
107106

107+
qdrant_libs = [
108+
"qdrant_client" # cannot install on 3.11 due to grcpio
109+
]
110+
108111
### NEEDED FOR DEVELOPER TESTING ONLY
109112

110113
dev_libs = [
@@ -138,7 +141,8 @@ def read(path, encoding="utf-8"):
138141
"document": document_libs,
139142
"udf": udf_libs,
140143
"notebook": notebook_libs,
141-
# everything except ray
144+
"qdrant": qdrant_libs,
145+
# everything except ray and qdrant
142146
"dev": dev_libs + vision_libs + document_libs + udf_libs + notebook_libs,
143147
}
144148

β€Žtest/interfaces/relational/test_relational_api.py

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
import unittest
16+
from test.markers import qdrant_skip_marker
1617
from test.util import (
1718
DummyObjectDetector,
1819
create_sample_video,
@@ -46,7 +47,9 @@ def setUpClass(cls):
4647
def setUp(self):
4748
self.evadb.catalog().reset()
4849
self.mnist_path = f"{EvaDB_ROOT_DIR}/data/mnist/mnist.mp4"
49-
load_udfs_for_testing(self.evadb,)
50+
load_udfs_for_testing(
51+
self.evadb,
52+
)
5053
self.images = f"{EvaDB_ROOT_DIR}/data/detoxify/*.jpg"
5154

5255
def tearDown(self):
@@ -57,15 +60,20 @@ def tearDown(self):
5760

5861
def test_relation_apis(self):
5962
cursor = self.conn.cursor()
60-
rel = cursor.load(self.mnist_path, table_name="mnist_video", format="video",)
63+
rel = cursor.load(
64+
self.mnist_path,
65+
table_name="mnist_video",
66+
format="video",
67+
)
6168
rel.execute()
6269

6370
rel = cursor.table("mnist_video")
6471
assert_frame_equal(rel.df(), cursor.query("select * from mnist_video;").df())
6572

6673
rel = rel.select("_row_id, id, data")
6774
assert_frame_equal(
68-
rel.df(), cursor.query("select _row_id, id, data from mnist_video;").df(),
75+
rel.df(),
76+
cursor.query("select _row_id, id, data from mnist_video;").df(),
6977
)
7078

7179
rel = rel.filter("id < 10")
@@ -88,7 +96,11 @@ def test_relation_apis(self):
8896
where id < 10 AND mnist.label = 1;"""
8997
assert_frame_equal(rel.df(), cursor.query(query).df())
9098

91-
rel = cursor.load(self.images, table_name="meme_images", format="image",)
99+
rel = cursor.load(
100+
self.images,
101+
table_name="meme_images",
102+
format="image",
103+
)
92104
rel.execute()
93105

94106
rel = cursor.table("meme_images").select("_row_id, name")
@@ -107,7 +119,11 @@ def test_relation_apis(self):
107119
def test_relation_api_chaining(self):
108120
cursor = self.conn.cursor()
109121

110-
rel = cursor.load(self.mnist_path, table_name="mnist_video", format="video",)
122+
rel = cursor.load(
123+
self.mnist_path,
124+
table_name="mnist_video",
125+
format="video",
126+
)
111127
rel.execute()
112128

113129
rel = (
@@ -126,7 +142,11 @@ def test_relation_api_chaining(self):
126142
def test_interleaving_calls(self):
127143
cursor = self.conn.cursor()
128144

129-
rel = cursor.load(self.mnist_path, table_name="mnist_video", format="video",)
145+
rel = cursor.load(
146+
self.mnist_path,
147+
table_name="mnist_video",
148+
format="video",
149+
)
130150
rel.execute()
131151

132152
rel = cursor.table("mnist_video")
@@ -142,11 +162,16 @@ def test_interleaving_calls(self):
142162
cursor.query("select _row_id, id from mnist_video where id > 10;").df(),
143163
)
144164

165+
@qdrant_skip_marker
145166
def test_create_index(self):
146167
cursor = self.conn.cursor()
147168

148169
# load some images
149-
rel = cursor.load(self.images, table_name="meme_images", format="image",)
170+
rel = cursor.load(
171+
self.images,
172+
table_name="meme_images",
173+
format="image",
174+
)
150175
rel.execute()
151176

152177
# todo support register udf
@@ -186,7 +211,11 @@ def test_create_udf_with_relational_api(self):
186211

187212
cursor = self.conn.cursor()
188213
# load video
189-
rel = cursor.load(video_file_path, table_name="dummy_video", format="video",)
214+
rel = cursor.load(
215+
video_file_path,
216+
table_name="dummy_video",
217+
format="video",
218+
)
190219
rel.execute()
191220

192221
create_dummy_object_detector_udf = cursor.create_udf(
@@ -238,7 +267,11 @@ def test_drop_with_relational_api(self):
238267

239268
cursor = self.conn.cursor()
240269
# load video
241-
rel = cursor.load(video_file_path, table_name="dummy_video", format="video",)
270+
rel = cursor.load(
271+
video_file_path,
272+
table_name="dummy_video",
273+
format="video",
274+
)
242275
rel.execute()
243276

244277
# Create dummy udf
@@ -294,13 +327,9 @@ def test_drop_with_relational_api(self):
294327
def test_pdf_similarity_search(self):
295328
conn = connect()
296329
cursor = conn.cursor()
297-
pdf_path1 = f"{EvaDB_ROOT_DIR}/data/documents/state_of_the_union.pdf"
298-
pdf_path2 = f"{EvaDB_ROOT_DIR}/data/documents/layout-parser-paper.pdf"
299-
300-
load_pdf = cursor.load(file_regex=pdf_path1, format="PDF", table_name="PDFs")
301-
load_pdf.execute()
330+
pdf_path = f"{EvaDB_ROOT_DIR}/data/documents/state_of_the_union.pdf"
302331

303-
load_pdf = cursor.load(file_regex=pdf_path2, format="PDF", table_name="PDFs")
332+
load_pdf = cursor.load(file_regex=pdf_path, format="PDF", table_name="PDFs")
304333
load_pdf.execute()
305334

306335
udf_check = cursor.drop_udf("SentenceFeatureExtractor")
@@ -316,7 +345,7 @@ def test_pdf_similarity_search(self):
316345
"faiss_index",
317346
table_name="PDFs",
318347
expr="SentenceFeatureExtractor(data)",
319-
using="QDRANT",
348+
using="FAISS",
320349
).df()
321350

322351
query = (
@@ -369,7 +398,11 @@ def test_show_relational(self):
369398

370399
cursor = self.conn.cursor()
371400
# load video
372-
rel = cursor.load(video_file_path, table_name="dummy_video", format="video",)
401+
rel = cursor.load(
402+
video_file_path,
403+
table_name="dummy_video",
404+
format="video",
405+
)
373406
rel.execute()
374407

375408
result = cursor.show("tables").df()
@@ -381,7 +414,11 @@ def test_explain_relational(self):
381414

382415
cursor = self.conn.cursor()
383416
# load video
384-
rel = cursor.load(video_file_path, table_name="dummy_video", format="video",)
417+
rel = cursor.load(
418+
video_file_path,
419+
table_name="dummy_video",
420+
format="video",
421+
)
385422
rel.execute()
386423

387424
result = cursor.explain("SELECT * FROM dummy_video").df()
@@ -396,7 +433,11 @@ def test_rename_relational(self):
396433

397434
cursor = self.conn.cursor()
398435
# load video
399-
rel = cursor.load(video_file_path, table_name="dummy_video", format="video",)
436+
rel = cursor.load(
437+
video_file_path,
438+
table_name="dummy_video",
439+
format="video",
440+
)
400441
rel.execute()
401442

402443
cursor.rename("dummy_video", "dummy_video_renamed").df()

β€Žtest/markers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
sys.version_info < (3, 8), reason="Test case requires asyncio support"
2525
)
2626

27+
qdrant_skip_marker = pytest.mark.skipif(
28+
sys.version_info.minor == 11,
29+
reason="qdrant requires grcpio which is broken on 3.11",
30+
)
31+
2732
windows_skip_marker = pytest.mark.skipif(
2833
sys.platform == "win32", reason="Test case not supported on Windows"
2934
)

β€Žtest/udfs/test_abstract_udf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def get_all_classes(module, level):
7575
class_list.append([obj])
7676
except OSError:
7777
pass
78+
except TypeError:
79+
pass
7880

7981
flat_class_list = [item for sublist in class_list for item in sublist]
8082
return set(flat_class_list)

0 commit comments

Comments
Β (0)