Skip to content

Commit

Permalink
Pin OpenAI Python client to <1.66.0 (#47643)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kaxil authored Mar 11, 2025
1 parent 01cee78 commit b364cf8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@
"openai": {
"deps": [
"apache-airflow>=2.9.0",
"openai[datalib]>=1.32.0"
"openai[datalib]>=1.32.0,<1.66.0"
],
"devel-deps": [],
"plugins": [],
Expand Down
8 changes: 4 additions & 4 deletions providers/openai/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ The package supports the following python versions: 3.9,3.10,3.11,3.12
Requirements
------------

=================== ==================
=================== ====================
PIP package Version required
=================== ==================
=================== ====================
``apache-airflow`` ``>=2.9.0``
``openai[datalib]`` ``>=1.32.0``
=================== ==================
``openai[datalib]`` ``>=1.32.0,<1.66.0``
=================== ====================

The changelog for the provider package can be found in the
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openai/1.5.2/changelog.html>`_.
2 changes: 1 addition & 1 deletion providers/openai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ requires-python = "~=3.9"
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=2.9.0",
"openai[datalib]>=1.32.0",
"openai[datalib]>=1.32.0,<1.66.0", # Pinned due to https://github.com/apache/airflow/issues/47642
]

[dependency-groups]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ def get_provider_info():
"connection-type": "openai",
}
],
"dependencies": ["apache-airflow>=2.9.0", "openai[datalib]>=1.32.0"],
"dependencies": ["apache-airflow>=2.9.0", "openai[datalib]>=1.32.0,<1.66.0"],
"devel-dependencies": [],
}

0 comments on commit b364cf8

Please sign in to comment.