-
Notifications
You must be signed in to change notification settings - Fork 16
Fix breaking changes from databricks-ai-bridge 0.4.2 #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fbdb4d5
55d5d46
43372bb
3a1a233
55eb076
a849087
2ab3244
5aca188
9a2429b
b151d04
fa2c242
3ef5ade
335a34e
dcdd809
b486c0e
7cc0e1e
22c2266
27f36d1
f82f1d5
38d15f5
6898b04
6e91b9c
579dad6
8e882b3
64e20e9
ac35b1e
a988886
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,52 @@ jobs: | |
- name: Run tests | ||
run: | | ||
pytest integrations/langchain/tests/unit_tests | ||
|
||
langchain_cross_version_test: | ||
runs-on: ubuntu-latest | ||
name: langchain_test (${{ matrix.python-version }}, ${{ matrix.version.name }}) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
version: | ||
- {ref: "databricks-ai-v0.4.0", name: "v0.4.0"} | ||
- {ref: "databricks-ai-v0.3.0", name: "v0.3.0"} | ||
- {ref: "databricks-ai-v0.2.0", name: "v0.2.0"} | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install . | ||
- name: Checkout langchain version | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.version.ref }} | ||
fetch-depth: 1 | ||
path: older-version | ||
- name: Replace langchain with older version | ||
run: | | ||
# Remove current langchain if it exists to avoid conflicts | ||
rm -rf integrations/langchain | ||
|
||
# Copy older version of langchain to the main repo | ||
cp -r older-version/integrations/langchain integrations/ | ||
- name: Install langchain dependency | ||
run: | | ||
pip install integrations/langchain[dev] | ||
- name: Run tests | ||
run: | | ||
# Only testing initialization since functionality can change | ||
pytest integrations/langchain/tests/unit_tests/test_vector_search_retriever_tool.py::test_init | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only testing basic init functionality here, since the functionality of other parts has changed. This still does catch the backwards compatibility issues that Serena saw. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add a comment saying the same? this is really awesome work! |
||
pytest integrations/langchain/tests/unit_tests/test_genie.py | ||
pytest integrations/langchain/tests/unit_tests/test_embeddings.py | ||
pytest integrations/langchain/tests/unit_tests/test_chat_models.py | ||
|
||
openai_test: | ||
runs-on: ubuntu-latest | ||
|
@@ -92,6 +138,49 @@ jobs: | |
run: | | ||
pytest integrations/openai/tests/unit_tests | ||
|
||
openai_cross_version_test: | ||
runs-on: ubuntu-latest | ||
name: openai_test (${{ matrix.python-version }}, ${{ matrix.version.name }}) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
version: | ||
- {ref: "databricks-ai-v0.4.0", name: "v0.4.0"} | ||
- {ref: "databricks-ai-v0.3.0", name: "v0.3.0"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install . | ||
- name: Checkout openai version | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.version.ref }} | ||
fetch-depth: 1 | ||
path: older-version | ||
- name: Replace openai with older version | ||
run: | | ||
# Remove current openai if it exists to avoid conflicts | ||
rm -rf integrations/openai | ||
|
||
# Copy older version of openai to the main repo | ||
cp -r older-version/integrations/openai integrations/ | ||
- name: Install openai dependency | ||
run: | | ||
pip install integrations/openai[dev] | ||
- name: Run tests | ||
run: | | ||
# Only testing initialization since functionality can change | ||
pytest integrations/openai/tests/unit_tests/test_vector_search_retriever_tool.py::test_vector_search_retriever_tool_init | ||
|
||
|
||
llamaindex_test: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,5 +111,19 @@ def make_document(row_index: int, score: float): | |
) | ||
def test_parse_vector_search_response(retriever_schema, ignore_cols, docs_with_score): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can we also add a test for what an old version of databricks-langchain would've done? |
||
assert ( | ||
parse_vector_search_response(search_resp, retriever_schema, ignore_cols) == docs_with_score | ||
parse_vector_search_response( | ||
search_resp, retriever_schema=retriever_schema, ignore_cols=ignore_cols | ||
) | ||
== docs_with_score | ||
) | ||
|
||
|
||
def test_parse_vector_search_response_without_retriever_schema(): | ||
assert ( | ||
parse_vector_search_response(search_resp, text_column="column_1", ignore_cols=["column_2"]) | ||
== construct_docs_with_score( | ||
page_content_column="column_2", | ||
column_3="column_3", | ||
column_4="column_4", | ||
), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests for vector search tool integration don't exist in
0.1.0