fix: re-export symbols in __init__.py files#9521
Conversation
Pull Request Test Coverage Report for Build 15679340982Details
💛 - Coveralls |
| from .streaming_chunk import AsyncStreamingCallbackT as AsyncStreamingCallbackT | ||
| from .streaming_chunk import ComponentInfo as ComponentInfo | ||
| from .streaming_chunk import StreamingCallbackT as StreamingCallbackT | ||
| from .streaming_chunk import StreamingChunk as StreamingChunk | ||
| from .streaming_chunk import SyncStreamingCallbackT as SyncStreamingCallbackT | ||
| from .streaming_chunk import ToolCallDelta as ToolCallDelta | ||
| from .streaming_chunk import select_streaming_callback as select_streaming_callback |
There was a problem hiding this comment.
A little annoying this gets so much more verbose but I understand why
There was a problem hiding this comment.
I initially did something like
from .streaming_chunk import AsyncStreamingCallbackT as AsyncStreamingCallbackT, ComponentInfo as ComponentInfo, ...
but ruff automatically converted the code into this format
| from .auth import Secret as Secret | ||
| from .auth import deserialize_secrets_inplace as deserialize_secrets_inplace | ||
| from .azure import default_azure_ad_token_provider as default_azure_ad_token_provider | ||
| from .base_serialization import _deserialize_value_with_schema as _deserialize_value_with_schema |
There was a problem hiding this comment.
Do we need to do this for private methods as well?
There was a problem hiding this comment.
I only applied the same change on everything present in __init__.py
I don't know why this specific method was originally exported in __init__.py
Maybe this is related:
haystack/haystack/utils/base_serialization.py
Lines 57 to 58 in a1484cb
There was a problem hiding this comment.
okay fair enough, let's leave it
| "unnecessary-comprehension", | ||
| "subprocess-run-check", | ||
| "singleton-comparison", |
There was a problem hiding this comment.
Just checking it seems like a lot of other unrelated disables were also removed?
There was a problem hiding this comment.
ah sorry, I forgot to mention this. This is an unrelated change I have done.
These ignored rules came from Haystack 1.x, so I removed from disabled rules all the rules that are not currently being violated.
|
@anakin87 looks good! Just a few comments. |
Related Issues
Proposed Changes:
from haystack.components.builders import ChatPromptBuilderinstead offrom haystack.components.builders.chat_prompt_builder import ChatPromptBuilder.How did you test it?
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.