Skip to content

Commit 03bc69f

Browse files
committed
Pin OpenAI Python client to <1.66.0
OpenAI provider Tests are failing with: ``` ___ ERROR collecting providers/openai/tests/unit/openai/hooks/test_openai.py ___ ImportError while importing test module '/opt/airflow/providers/openai/tests/unit/openai/hooks/test_openai.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.9/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) providers/openai/tests/unit/openai/hooks/test_openai.py:25: in <module> from openai.types.beta import ( E ImportError: cannot import name 'VectorStore' from 'openai.types.beta' (/usr/local/lib/python3.9/site-packages/openai/types/beta/__init__.py ``` This is due to openai/openai-python#2175
1 parent 85487a8 commit 03bc69f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

generated/provider_dependencies.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@
969969
"openai": {
970970
"deps": [
971971
"apache-airflow>=2.9.0",
972-
"openai[datalib]>=1.32.0"
972+
"openai[datalib]>=1.32.0,<1.66.0"
973973
],
974974
"devel-deps": [],
975975
"plugins": [],

providers/openai/README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ The package supports the following python versions: 3.9,3.10,3.11,3.12
5050
Requirements
5151
------------
5252

53-
=================== ==================
53+
=================== ====================
5454
PIP package Version required
55-
=================== ==================
55+
=================== ====================
5656
``apache-airflow`` ``>=2.9.0``
57-
``openai[datalib]`` ``>=1.32.0``
58-
=================== ==================
57+
``openai[datalib]`` ``>=1.32.0,<1.66.0``
58+
=================== ====================
5959

6060
The changelog for the provider package can be found in the
6161
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openai/1.5.2/changelog.html>`_.

providers/openai/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ requires-python = "~=3.9"
5858
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
5959
dependencies = [
6060
"apache-airflow>=2.9.0",
61-
"openai[datalib]>=1.32.0",
61+
"openai[datalib]>=1.32.0,<1.66.0", # Pinned due to https://github.com/apache/airflow/issues/47642
6262
]
6363

6464
[dependency-groups]

providers/openai/src/airflow/providers/openai/get_provider_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ def get_provider_info():
6464
"connection-type": "openai",
6565
}
6666
],
67-
"dependencies": ["apache-airflow>=2.9.0", "openai[datalib]>=1.32.0"],
67+
"dependencies": ["apache-airflow>=2.9.0", "openai[datalib]>=1.32.0,<1.66.0"],
6868
"devel-dependencies": [],
6969
}

0 commit comments

Comments
 (0)