Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc35bef

Browse files
authored
fix some python deps (#37668)
* fix some python deps * Add import guards * lint * lint
1 parent 4fe6173 commit bc35bef

13 files changed

Lines changed: 16 additions & 91 deletions

sdks/python/apache_beam/ml/rag/ingestion/milvus_search_it_test.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
from typing import cast
2323

2424
import pytest
25-
from pymilvus import CollectionSchema
26-
from pymilvus import DataType
27-
from pymilvus import FieldSchema
28-
from pymilvus import MilvusClient
29-
from pymilvus.exceptions import MilvusException
30-
from pymilvus.milvus_client import IndexParams
3125

3226
import apache_beam as beam
3327
from apache_beam.ml.rag.ingestion.jdbc_common import WriteConfig
@@ -41,11 +35,21 @@
4135
from apache_beam.ml.rag.utils import unpack_dataclass_with_kwargs
4236
from apache_beam.testing.test_pipeline import TestPipeline
4337

38+
# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
4439
try:
40+
from pymilvus import CollectionSchema
41+
from pymilvus import DataType
42+
from pymilvus import FieldSchema
43+
from pymilvus import MilvusClient
44+
from pymilvus.exceptions import MilvusException
45+
from pymilvus.milvus_client import IndexParams
46+
4547
from apache_beam.ml.rag.ingestion.milvus_search import MilvusVectorWriterConfig
4648
from apache_beam.ml.rag.ingestion.milvus_search import MilvusWriteConfig
47-
except ImportError as e:
48-
raise unittest.SkipTest(f'Milvus dependencies not installed: {str(e)}')
49+
PYMILVUS_AVAILABLE = True
50+
except ImportError:
51+
PYMILVUS_AVAILABLE = False
52+
# pylint: enable=wrong-import-order, wrong-import-position, ungrouped-imports
4953

5054

5155
def _construct_index_params():
@@ -158,6 +162,7 @@ def drop_collection(client: MilvusClient, collection_name: str):
158162

159163

160164
@pytest.mark.require_docker_in_docker
165+
@unittest.skipIf(not PYMILVUS_AVAILABLE, 'pymilvus is not installed.')
161166
@unittest.skipUnless(
162167
platform.system() == "Linux",
163168
"Test runs only on Linux due to lack of support, as yet, for nested "

sdks/python/container/ml/py310/base_image_requirements.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# Reach out to a committer if you need help.
2323

2424
absl-py==2.4.0
25-
aiodns==4.0.0
2625
aiofiles==25.1.0
2726
aiohappyeyeballs==2.6.1
2827
aiohttp==3.13.3
@@ -34,11 +33,9 @@ astunparse==1.6.3
3433
async-timeout==5.0.1
3534
attrs==25.4.0
3635
backports.tarfile==1.2.0
37-
backports.zstd==1.3.0
3836
beartype==0.22.9
3937
beautifulsoup4==4.14.3
4038
betterproto==2.0.0b7
41-
brotli==1.2.0
4239
bs4==0.0.2
4340
build==1.4.0
4441
cachetools==6.2.6
@@ -135,7 +132,6 @@ Markdown==3.10.2
135132
markdown-it-py==4.0.0
136133
MarkupSafe==3.0.3
137134
mdurl==0.1.2
138-
milvus-lite==2.5.1
139135
ml_dtypes==0.5.4
140136
mmh3==5.2.0
141137
mock==5.2.0
@@ -163,7 +159,6 @@ pg8000==1.31.5
163159
pillow==12.1.1
164160
pip==26.0.1
165161
pluggy==1.6.0
166-
pminit==1.3.0
167162
propcache==0.4.1
168163
proto-plus==1.27.1
169164
protobuf==5.29.6
@@ -172,13 +167,11 @@ pyarrow==23.0.1
172167
pyarrow-hotfix==0.7
173168
pyasn1==0.6.2
174169
pyasn1_modules==0.4.2
175-
pycares==5.0.1
176170
pycparser==3.0
177171
pydantic==2.12.5
178172
pydantic_core==2.41.5
179173
Pygments==2.19.2
180174
PyHamcrest==2.1.0
181-
pymilvus==2.5.18
182175
pymongo==4.16.0
183176
PyMySQL==1.1.2
184177
pyparsing==3.3.2
@@ -189,7 +182,6 @@ pytest-xdist==3.8.0
189182
python-dateutil==2.9.0.post0
190183
python-dotenv==1.2.1
191184
python-tds==1.17.1
192-
pythonmonkey==1.3.0
193185
pytz==2025.2
194186
PyYAML==6.0.3
195187
referencing==0.37.0
@@ -229,7 +221,6 @@ transformers==4.55.4
229221
typing-inspection==0.4.2
230222
typing_extensions==4.15.0
231223
tzdata==2025.3
232-
ujson==5.11.0
233224
uritemplate==4.2.0
234225
urllib3==2.6.3
235226
virtualenv-clone==0.5.7

sdks/python/container/ml/py310/gpu_image_requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ Markdown==3.10.2
157157
markdown-it-py==4.0.0
158158
MarkupSafe==3.0.3
159159
mdurl==0.1.2
160-
milvus-lite==2.5.1
161160
mistral_common==1.9.1
162161
ml_dtypes==0.5.4
163162
mmh3==5.2.0
@@ -231,7 +230,6 @@ pydantic-settings==2.13.1
231230
pydantic_core==2.41.5
232231
Pygments==2.19.2
233232
PyHamcrest==2.1.0
234-
pymilvus==2.5.18
235233
pymongo==4.16.0
236234
PyMySQL==1.1.2
237235
pyparsing==3.3.2
@@ -299,7 +297,6 @@ typer==0.24.1
299297
typing-inspection==0.4.2
300298
typing_extensions==4.15.0
301299
tzdata==2025.3
302-
ujson==5.11.0
303300
uritemplate==4.2.0
304301
urllib3==2.6.3
305302
uvicorn==0.41.0

sdks/python/container/ml/py311/base_image_requirements.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# Reach out to a committer if you need help.
2323

2424
absl-py==2.4.0
25-
aiodns==4.0.0
2625
aiofiles==25.1.0
2726
aiohappyeyeballs==2.6.1
2827
aiohttp==3.13.3
@@ -33,11 +32,9 @@ asn1crypto==1.5.1
3332
astunparse==1.6.3
3433
attrs==25.4.0
3534
backports.tarfile==1.2.0
36-
backports.zstd==1.3.0
3735
beartype==0.22.9
3836
beautifulsoup4==4.14.3
3937
betterproto==2.0.0b7
40-
brotli==1.2.0
4138
bs4==0.0.2
4239
build==1.4.0
4340
cachetools==6.2.6
@@ -133,7 +130,6 @@ Markdown==3.10.2
133130
markdown-it-py==4.0.0
134131
MarkupSafe==3.0.3
135132
mdurl==0.1.2
136-
milvus-lite==2.5.1
137133
ml_dtypes==0.5.4
138134
mmh3==5.2.0
139135
mock==5.2.0
@@ -161,7 +157,6 @@ pg8000==1.31.5
161157
pillow==12.1.1
162158
pip==26.0.1
163159
pluggy==1.6.0
164-
pminit==1.3.0
165160
propcache==0.4.1
166161
proto-plus==1.27.1
167162
protobuf==5.29.6
@@ -170,13 +165,11 @@ pyarrow==23.0.1
170165
pyarrow-hotfix==0.7
171166
pyasn1==0.6.2
172167
pyasn1_modules==0.4.2
173-
pycares==5.0.1
174168
pycparser==3.0
175169
pydantic==2.12.5
176170
pydantic_core==2.41.5
177171
Pygments==2.19.2
178172
PyHamcrest==2.1.0
179-
pymilvus==2.5.18
180173
pymongo==4.16.0
181174
PyMySQL==1.1.2
182175
pyparsing==3.3.2
@@ -187,7 +180,6 @@ pytest-xdist==3.8.0
187180
python-dateutil==2.9.0.post0
188181
python-dotenv==1.2.1
189182
python-tds==1.17.1
190-
pythonmonkey==1.3.0
191183
pytz==2025.2
192184
PyYAML==6.0.3
193185
referencing==0.37.0
@@ -226,7 +218,6 @@ transformers==4.55.4
226218
typing-inspection==0.4.2
227219
typing_extensions==4.15.0
228220
tzdata==2025.3
229-
ujson==5.11.0
230221
uritemplate==4.2.0
231222
urllib3==2.6.3
232223
virtualenv-clone==0.5.7

sdks/python/container/ml/py311/gpu_image_requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ Markdown==3.10.2
155155
markdown-it-py==4.0.0
156156
MarkupSafe==3.0.3
157157
mdurl==0.1.2
158-
milvus-lite==2.5.1
159158
mistral_common==1.9.1
160159
ml_dtypes==0.5.4
161160
mmh3==5.2.0
@@ -229,7 +228,6 @@ pydantic-settings==2.13.1
229228
pydantic_core==2.41.5
230229
Pygments==2.19.2
231230
PyHamcrest==2.1.0
232-
pymilvus==2.5.18
233231
pymongo==4.16.0
234232
PyMySQL==1.1.2
235233
pyparsing==3.3.2
@@ -296,7 +294,6 @@ typer==0.24.1
296294
typing-inspection==0.4.2
297295
typing_extensions==4.15.0
298296
tzdata==2025.3
299-
ujson==5.11.0
300297
uritemplate==4.2.0
301298
urllib3==2.6.3
302299
uvicorn==0.41.0

sdks/python/container/ml/py312/base_image_requirements.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# Reach out to a committer if you need help.
2323

2424
absl-py==2.4.0
25-
aiodns==4.0.0
2625
aiofiles==25.1.0
2726
aiohappyeyeballs==2.6.1
2827
aiohttp==3.13.3
@@ -32,11 +31,9 @@ anyio==4.12.1
3231
asn1crypto==1.5.1
3332
astunparse==1.6.3
3433
attrs==25.4.0
35-
backports.zstd==1.3.0
3634
beartype==0.22.9
3735
beautifulsoup4==4.14.3
3836
betterproto==2.0.0b7
39-
brotli==1.2.0
4037
bs4==0.0.2
4138
build==1.4.0
4239
cachetools==6.2.6
@@ -132,7 +129,6 @@ Markdown==3.10.2
132129
markdown-it-py==4.0.0
133130
MarkupSafe==3.0.3
134131
mdurl==0.1.2
135-
milvus-lite==2.5.1
136132
ml_dtypes==0.5.4
137133
mmh3==5.2.0
138134
mock==5.2.0
@@ -160,7 +156,6 @@ pg8000==1.31.5
160156
pillow==12.1.1
161157
pip==26.0.1
162158
pluggy==1.6.0
163-
pminit==1.3.0
164159
propcache==0.4.1
165160
proto-plus==1.27.1
166161
protobuf==5.29.6
@@ -169,13 +164,11 @@ pyarrow==23.0.1
169164
pyarrow-hotfix==0.7
170165
pyasn1==0.6.2
171166
pyasn1_modules==0.4.2
172-
pycares==5.0.1
173167
pycparser==3.0
174168
pydantic==2.12.5
175169
pydantic_core==2.41.5
176170
Pygments==2.19.2
177171
PyHamcrest==2.1.0
178-
pymilvus==2.5.18
179172
pymongo==4.16.0
180173
PyMySQL==1.1.2
181174
pyparsing==3.3.2
@@ -186,7 +179,6 @@ pytest-xdist==3.8.0
186179
python-dateutil==2.9.0.post0
187180
python-dotenv==1.2.1
188181
python-tds==1.17.1
189-
pythonmonkey==1.3.0
190182
pytz==2025.2
191183
PyYAML==6.0.3
192184
referencing==0.37.0
@@ -225,7 +217,6 @@ transformers==4.55.4
225217
typing-inspection==0.4.2
226218
typing_extensions==4.15.0
227219
tzdata==2025.3
228-
ujson==5.11.0
229220
uritemplate==4.2.0
230221
urllib3==2.6.3
231222
virtualenv-clone==0.5.7

sdks/python/container/ml/py312/gpu_image_requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ Markdown==3.10.2
154154
markdown-it-py==4.0.0
155155
MarkupSafe==3.0.3
156156
mdurl==0.1.2
157-
milvus-lite==2.5.1
158157
mistral_common==1.9.1
159158
ml_dtypes==0.5.4
160159
mmh3==5.2.0
@@ -228,7 +227,6 @@ pydantic-settings==2.13.1
228227
pydantic_core==2.41.5
229228
Pygments==2.19.2
230229
PyHamcrest==2.1.0
231-
pymilvus==2.5.18
232230
pymongo==4.16.0
233231
PyMySQL==1.1.2
234232
pyparsing==3.3.2
@@ -295,7 +293,6 @@ typer==0.24.1
295293
typing-inspection==0.4.2
296294
typing_extensions==4.15.0
297295
tzdata==2025.3
298-
ujson==5.11.0
299296
uritemplate==4.2.0
300297
urllib3==2.6.3
301298
uvicorn==0.41.0

sdks/python/container/ml/py313/base_image_requirements.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# Reach out to a committer if you need help.
2323

2424
absl-py==2.4.0
25-
aiodns==4.0.0
2625
aiofiles==25.1.0
2726
aiohappyeyeballs==2.6.1
2827
aiohttp==3.13.3
@@ -32,11 +31,9 @@ anyio==4.12.1
3231
asn1crypto==1.5.1
3332
astunparse==1.6.3
3433
attrs==25.4.0
35-
backports.zstd==1.3.0
3634
beartype==0.22.9
3735
beautifulsoup4==4.14.3
3836
betterproto==2.0.0b6
39-
brotli==1.2.0
4037
bs4==0.0.2
4138
build==1.4.0
4239
cachetools==6.2.6
@@ -158,7 +155,6 @@ pg8000==1.31.5
158155
pillow==12.1.1
159156
pip==26.0.1
160157
pluggy==1.6.0
161-
pminit==1.3.0
162158
propcache==0.4.1
163159
proto-plus==1.27.1
164160
protobuf==6.33.5
@@ -167,13 +163,11 @@ pyarrow==23.0.1
167163
pyarrow-hotfix==0.7
168164
pyasn1==0.6.2
169165
pyasn1_modules==0.4.2
170-
pycares==5.0.1
171166
pycparser==3.0
172167
pydantic==2.12.5
173168
pydantic_core==2.41.5
174169
Pygments==2.19.2
175170
PyHamcrest==2.1.0
176-
pymilvus==2.6.9
177171
pymongo==4.16.0
178172
PyMySQL==1.1.2
179173
pyparsing==3.3.2
@@ -184,7 +178,6 @@ pytest-xdist==3.8.0
184178
python-dateutil==2.9.0.post0
185179
python-dotenv==1.2.1
186180
python-tds==1.17.1
187-
pythonmonkey==1.3.0
188181
pytz==2025.2
189182
PyYAML==6.0.3
190183
referencing==0.37.0

0 commit comments

Comments
 (0)