WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 45916a3

Browse files
Atul SinghAtul Singh
authored andcommitted
Adding retries and pool to Weaviate dags to handle connection latency issues
1 parent d9c826e commit 45916a3

File tree

7 files changed

+63
-0
lines changed

7 files changed

+63
-0
lines changed

providers/weaviate/tests/system/weaviate/example_weaviate_cohere.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19+
from datetime import timedelta
20+
1921
import pendulum
2022

2123
try:
@@ -28,10 +30,17 @@
2830

2931
COLLECTION_NAME = "weaviate_cohere_example_collection"
3032

33+
default_args = {
34+
"retries": 5,
35+
"retry_delay": timedelta(seconds=15),
36+
"pool": "weaviate_pool",
37+
}
38+
3139

3240
@dag(
3341
schedule=None,
3442
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
43+
default_args=default_args,
3544
catchup=False,
3645
tags=["example", "weaviate", "cohere"],
3746
)

providers/weaviate/tests/system/weaviate/example_weaviate_dynamic_mapping_dag.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19+
from datetime import timedelta
20+
1921
import pendulum
2022
from weaviate.collections.classes.config import Configure
2123

@@ -28,10 +30,17 @@
2830

2931
COLLECTION_NAMES = ["Weaviate_DTM_example_collection_1", "Weaviate_DTM_example_collection_2"]
3032

33+
default_args = {
34+
"retries": 5,
35+
"retry_delay": timedelta(seconds=15),
36+
"pool": "weaviate_pool",
37+
}
38+
3139

3240
@dag(
3341
schedule=None,
3442
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
43+
default_args=default_args,
3544
catchup=False,
3645
tags=["example", "weaviate"],
3746
)

providers/weaviate/tests/system/weaviate/example_weaviate_openai.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from __future__ import annotations
1818

1919
import json
20+
from datetime import timedelta
2021
from pathlib import Path
2122

2223
import pendulum
@@ -32,10 +33,17 @@
3233

3334
COLLECTION_NAME = "Weaviate_openai_example_collection"
3435

36+
default_args = {
37+
"retries": 5,
38+
"retry_delay": timedelta(seconds=15),
39+
"pool": "weaviate_pool",
40+
}
41+
3542

3643
@dag(
3744
schedule=None,
3845
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
46+
default_args=default_args,
3947
catchup=False,
4048
tags=["example", "weaviate"],
4149
)

providers/weaviate/tests/system/weaviate/example_weaviate_operator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19+
from datetime import timedelta
20+
1921
import pendulum
2022
from weaviate.classes.config import DataType, Property
2123
from weaviate.collections.classes.config import Configure
@@ -92,9 +94,17 @@ def get_data_without_vectors(*args, **kwargs):
9294
return sample_data_without_vector
9395

9496

97+
default_args = {
98+
"retries": 5,
99+
"retry_delay": timedelta(seconds=15),
100+
"pool": "weaviate_pool",
101+
}
102+
103+
95104
@dag(
96105
schedule=None,
97106
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
107+
default_args=default_args,
98108
catchup=False,
99109
tags=["example", "weaviate"],
100110
)

providers/weaviate/tests/system/weaviate/example_weaviate_using_hook.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19+
from datetime import timedelta
20+
1921
import pendulum
2022
from weaviate.classes.config import DataType, Property
2123
from weaviate.collections.classes.config import Configure
@@ -28,10 +30,17 @@
2830

2931
COLLECTION_NAME = "QuestionWithOpenAIVectorizerUsingHook"
3032

33+
default_args = {
34+
"retries": 5,
35+
"retry_delay": timedelta(seconds=15),
36+
"pool": "weaviate_pool",
37+
}
38+
3139

3240
@dag(
3341
schedule=None,
3442
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
43+
default_args=default_args,
3544
catchup=False,
3645
tags=["example", "weaviate"],
3746
)

providers/weaviate/tests/system/weaviate/example_weaviate_vectorizer_dag.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19+
from datetime import timedelta
20+
1921
import pendulum
2022
from weaviate.collections.classes.config import Configure
2123

@@ -28,10 +30,17 @@
2830

2931
COLLECTION_NAME = "Weaviate_with_vectorizer_example_collection"
3032

33+
default_args = {
34+
"retries": 5,
35+
"retry_delay": timedelta(seconds=15),
36+
"pool": "weaviate_pool",
37+
}
38+
3139

3240
@dag(
3341
schedule=None,
3442
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
43+
default_args=default_args,
3544
catchup=False,
3645
tags=["example", "weaviate"],
3746
)

providers/weaviate/tests/system/weaviate/example_weaviate_without_vectorizer_dag.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19+
from datetime import timedelta
20+
1921
import pendulum
2022

2123
try:
@@ -28,10 +30,17 @@
2830

2931
COLLECTION_NAME = "Weaviate_example_without_vectorizer_collection"
3032

33+
default_args = {
34+
"retries": 5,
35+
"retry_delay": timedelta(seconds=15),
36+
"pool": "weaviate_pool",
37+
}
38+
3139

3240
@dag(
3341
schedule=None,
3442
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
43+
default_args=default_args,
3544
catchup=False,
3645
tags=["example", "weaviate"],
3746
)

0 commit comments

Comments
 (0)