-
Notifications
You must be signed in to change notification settings - Fork 125
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
refactor: Refactored the way of warnings #864
base: dev
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
and running this code:
Clicking on /.../qdrant_client/check_depr.py:59 path should lead to |
Co-authored-by: George <[email protected]>
show_warning( | ||
message=f"Collection appears to be None before closing. The existing collections are: " | ||
f"{list(self.collections.keys())}", | ||
category=UserWarning, | ||
stacklevel=5, |
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.
stacklevel should be 4 and it should also be show_warning_once, since we don't provide collection name here
the output with stacklevel=5:
sys:1: UserWarning: Collection appears to be None before closing. The existing collections are: ['test']
stacklevel=4:
/.../qdrant_client/check_warnings/local_close_collection.py:6: UserWarning: Collection appears to be None before closing. The existing collections are: ['test']
cl.close()
/.../qdrant/qdrant_client/qdrant_client/qdrant_client.py:157: UserWarning: Collection appears to be None before closing. The existing collections are: ['test']
the script I used to reproduce:
from qdrant_client import QdrantClient, models
cl = QdrantClient(":memory:")
cl.create_collection('test', vectors_config=models.VectorParams(size=2, distance=models.Distance.COSINE))
cl._client.collections = {x: None for x in cl._client.collections}
cl.close()
@@ -119,6 +121,7 @@ def _load(self) -> None: | |||
"with large datasets.", | |||
category=UserWarning, | |||
idx="large-local-collection", | |||
stacklevel=6, |
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.
might be show_warning, since we are providing collection name here
warnings.warn("Auth token provider is used with an insecure connection.") | ||
show_warning( | ||
message="Auth token provider is used with an insecure connection.", | ||
category=RuntimeWarning, |
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.
I think it is UserWarning
warnings.warn("Api key is used with an insecure connection.") | ||
show_warning( | ||
message="Api key is used with an insecure connection.", | ||
category=RuntimeWarning, |
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.
I think it is UserWarning
Also
is still using logging.warning Should be updated here qdrant-client/tools/async_client_generator/transformers/remote/function_def_transformer.py Line 38 in 9b89888
|
All Submissions:
dev
branch. Did you create your branch fromdev
?New Feature Submissions:
pre-commit
withpip3 install pre-commit
and set up hooks withpre-commit install
?Changes to Core Features: