-
Notifications
You must be signed in to change notification settings - Fork 396
Fix or silence warnings emitted by tests #305
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
Fix or silence warnings emitted by tests #305
Conversation
…being unset Signed-off-by: David Gardner <dagardner@nvidia.com>
…ing about this not being set. Remove definition of pytest_plugins this is not a supported pytest config and triggers a warning Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…classes to be collected Signed-off-by: David Gardner <dagardner@nvidia.com>
…classes to be collected Signed-off-by: David Gardner <dagardner@nvidia.com>
…://docs.pydantic.dev/2.10/migration/#changes-to-pydanticbasemodel Signed-off-by: David Gardner <dagardner@nvidia.com>
…re being emitted Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…s://pandas.pydata.org/docs/reference/api/pandas.core.groupby.DataFrameGroupBy.apply.html Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…ment Signed-off-by: David Gardner <dagardner@nvidia.com>
…dependency on langchain-community (this is currently a transitory dep of ragas) Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…ove-warnings Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…use new fixture Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
… pull_intermediate, avoids issue where pull_intermediate is left unawaited when the workflow has multiple outputs Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…e) to avoid warning from the nim client Signed-off-by: David Gardner <dagardner@nvidia.com>
… mem0), remove once qdrant/qdrant-client#983 is resolved Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…nore, since this warning was also bein emitted from other parts of the code base Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…ove-warnings Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…thon 3.11 Signed-off-by: David Gardner <dagardner@nvidia.com>
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.
Pull Request Overview
This PR addresses various warning messages and deprecation issues while also improving asynchronous handling and renaming test classes to avoid unintended test discovery by pytest. Key changes include:
- Suppressing and fixing deprecation and syntax warnings, notably for Pydantic and qdrant-client.
- Renaming several test classes (e.g., from “Test…” to “Custom…” or “T…” prefixes) to prevent pytest from incorrectly treating non-test classes as tests.
- Updating asynchronous calls and coroutine cancellation patterns and adding the langchain-community dependency as required.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/aiq/utils/test_yaml_tools.py | Renamed a config class to avoid unintended test discovery. |
| tests/aiq/retriever/test_retrievers.py | Renamed Milvus client and corrected spelling for collection names; updated async calls for search methods. |
| tests/aiq/front_ends/fastapi/test_fastapi_front_end_plugin.py | Renamed worker class to align with naming conventions. |
| tests/aiq/eval/test_evaluate.py | Modified evaluation logic to check output mode and cancel asynchronous tasks on exception. |
| tests/aiq/builder/test_builder.py | Renamed various provider and config classes to avoid pytest conflicts and updated warning expectations. |
| src/aiq/runtime/loader.py | Adjusted entry point aggregation to correctly convert iterables to lists. |
| src/aiq/profiler/inference_optimization/llm_metrics.py | Modified groupby processing for metrics calculation. |
| src/aiq/profiler/inference_optimization/data_models.py | Switched from update_forward_refs to model_rebuild per updated Pydantic practices. |
| src/aiq/observability/async_otel_listener.py | Added warnings filtering to silence known deprecation warnings. |
| src/aiq/eval/evaluate.py | Added a pre-check for workflows with multiple outputs and improved coroutine cancellation in error handling. |
| src/aiq/cli/commands/start.py | Changed the command group class type from click.MultiCommand to click.Group. |
| pyproject.toml | Updated warning filters and adjusted asynchronous loop settings. |
| packages/aiqtoolkit_test/src/aiq/test/embedder.py | Updated import for DeterministicFakeEmbedding to use langchain-community. |
| packages/aiqtoolkit_test/pyproject.toml | Added dependency on langchain-community. |
| packages/aiqtoolkit_mem0ai/tests/test_mem0_editor.py | Updated fixture type hint for the mocked memory client. |
| packages/aiqtoolkit_agno/tests/test_tool_wrapper.py | Modified async call patterns to rely on provided event loops rather than run_coroutine_threadsafe. |
| examples/profiler_agent/src/aiq_profiler_agent/tool/flow_chart.py | Removed the explicit edgecolor from the rectangle, likely affecting diagram styling. |
| .vale.ini | Updated file extensions to include “.mdx” alongside “.md” and “.rst”. |
Comments suppressed due to low confidence (2)
src/aiq/runtime/loader.py:135
- The change from x + y to list(x) + list(y) ensures that the entrypoint iterables are properly converted to lists before concatenation. This avoids unexpected type errors if x and y aren't lists.
aiq_plugins = reduce(lambda x, y: list(x) + list(y), [entry_points.select(group=y) for y in plugin_groups])
tests/aiq/retriever/test_retrievers.py:242
- The collection name spelling was corrected from 'collecion1' to 'collection1'. Verify that this change is consistent with the rest of the codebase.
milvus_retriever.bind(top_k=2, collection_name="collection1")
Signed-off-by: David Gardner <dagardner@nvidia.com>
…ove-warnings Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
|
/merge |
* `pytest` now runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46. * Update code to avoid several deprecation warnings (mostly Pydantic) * Silence warnings being emitted by weave that we have no control over (wandb/weave#4533 & wandb/weave#3666) * Add a dependency on `langchain-community` to `aiqtoolkit-test` needed for the `DeterministicFakeEmbedding` class (this is currently a transitory dep of ragas) * Renamed test classes beginning with `Test` which were not test classes, to prevent pytest from attempting to run them. * Avoid mocking the `asyncio.run_coroutine_threadsafe` method, this ensures that coroutines are awaited. * Update `src/aiq/eval/evaluate.py` such that coroutines are only started after passing the `if not session_manager.workflow.has_single_output` check, and in the event of an exception, cancel any running coroutines in the exception handler. * Ignore syntax warnings being emitted by [qdrant-client](https://github.com/qdrant/qdrant-client) used by mem0, remove once the fix for qdrant/qdrant-client#983 is released. Closes NVIDIA#308 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#305 Signed-off-by: Greg Freeman <gfreeman@nvidia.com>
* `pytest` now runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46. * Update code to avoid several deprecation warnings (mostly Pydantic) * Silence warnings being emitted by weave that we have no control over (wandb/weave#4533 & wandb/weave#3666) * Add a dependency on `langchain-community` to `aiqtoolkit-test` needed for the `DeterministicFakeEmbedding` class (this is currently a transitory dep of ragas) * Renamed test classes beginning with `Test` which were not test classes, to prevent pytest from attempting to run them. * Avoid mocking the `asyncio.run_coroutine_threadsafe` method, this ensures that coroutines are awaited. * Update `src/aiq/eval/evaluate.py` such that coroutines are only started after passing the `if not session_manager.workflow.has_single_output` check, and in the event of an exception, cancel any running coroutines in the exception handler. * Ignore syntax warnings being emitted by [qdrant-client](https://github.com/qdrant/qdrant-client) used by mem0, remove once the fix for qdrant/qdrant-client#983 is released. Closes NVIDIA#308 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#305 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
* `pytest` now runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46. * Update code to avoid several deprecation warnings (mostly Pydantic) * Silence warnings being emitted by weave that we have no control over (wandb/weave#4533 & wandb/weave#3666) * Add a dependency on `langchain-community` to `aiqtoolkit-test` needed for the `DeterministicFakeEmbedding` class (this is currently a transitory dep of ragas) * Renamed test classes beginning with `Test` which were not test classes, to prevent pytest from attempting to run them. * Avoid mocking the `asyncio.run_coroutine_threadsafe` method, this ensures that coroutines are awaited. * Update `src/aiq/eval/evaluate.py` such that coroutines are only started after passing the `if not session_manager.workflow.has_single_output` check, and in the event of an exception, cancel any running coroutines in the exception handler. * Ignore syntax warnings being emitted by [qdrant-client](https://github.com/qdrant/qdrant-client) used by mem0, remove once the fix for qdrant/qdrant-client#983 is released. Closes NVIDIA#308 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#305 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
* `pytest` now runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46. * Update code to avoid several deprecation warnings (mostly Pydantic) * Silence warnings being emitted by weave that we have no control over (wandb/weave#4533 & wandb/weave#3666) * Add a dependency on `langchain-community` to `aiqtoolkit-test` needed for the `DeterministicFakeEmbedding` class (this is currently a transitory dep of ragas) * Renamed test classes beginning with `Test` which were not test classes, to prevent pytest from attempting to run them. * Avoid mocking the `asyncio.run_coroutine_threadsafe` method, this ensures that coroutines are awaited. * Update `src/aiq/eval/evaluate.py` such that coroutines are only started after passing the `if not session_manager.workflow.has_single_output` check, and in the event of an exception, cancel any running coroutines in the exception handler. * Ignore syntax warnings being emitted by [qdrant-client](https://github.com/qdrant/qdrant-client) used by mem0, remove once the fix for qdrant/qdrant-client#983 is released. Closes NVIDIA#308 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#305 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
* `pytest` now runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46. * Update code to avoid several deprecation warnings (mostly Pydantic) * Silence warnings being emitted by weave that we have no control over (wandb/weave#4533 & wandb/weave#3666) * Add a dependency on `langchain-community` to `aiqtoolkit-test` needed for the `DeterministicFakeEmbedding` class (this is currently a transitory dep of ragas) * Renamed test classes beginning with `Test` which were not test classes, to prevent pytest from attempting to run them. * Avoid mocking the `asyncio.run_coroutine_threadsafe` method, this ensures that coroutines are awaited. * Update `src/aiq/eval/evaluate.py` such that coroutines are only started after passing the `if not session_manager.workflow.has_single_output` check, and in the event of an exception, cancel any running coroutines in the exception handler. * Ignore syntax warnings being emitted by [qdrant-client](https://github.com/qdrant/qdrant-client) used by mem0, remove once the fix for qdrant/qdrant-client#983 is released. Closes NVIDIA#308 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#305
* `pytest` now runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46. * Update code to avoid several deprecation warnings (mostly Pydantic) * Silence warnings being emitted by weave that we have no control over (wandb/weave#4533 & wandb/weave#3666) * Add a dependency on `langchain-community` to `aiqtoolkit-test` needed for the `DeterministicFakeEmbedding` class (this is currently a transitory dep of ragas) * Renamed test classes beginning with `Test` which were not test classes, to prevent pytest from attempting to run them. * Avoid mocking the `asyncio.run_coroutine_threadsafe` method, this ensures that coroutines are awaited. * Update `src/aiq/eval/evaluate.py` such that coroutines are only started after passing the `if not session_manager.workflow.has_single_output` check, and in the event of an exception, cancel any running coroutines in the exception handler. * Ignore syntax warnings being emitted by [qdrant-client](https://github.com/qdrant/qdrant-client) used by mem0, remove once the fix for qdrant/qdrant-client#983 is released. Closes NVIDIA#308 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#305
Description
pytestnow runs without reporting any warnings on 3.12 (there is a warning 3.11 that pytest is unable to silence), down from 46.langchain-communitytoaiqtoolkit-testneeded for theDeterministicFakeEmbeddingclass (this is currently a transitory dep of ragas)Testwhich were not test classes, to prevent pytest from attempting to run them.asyncio.run_coroutine_threadsafemethod, this ensures that coroutines are awaited.src/aiq/eval/evaluate.pysuch that coroutines are only started after passing theif not session_manager.workflow.has_single_outputcheck, and in the event of an exception, cancel any running coroutines in the exception handler.SyntaxWarningon run qdrant/qdrant-client#983 is released.Closes #308
By Submitting this PR I confirm: