-
Notifications
You must be signed in to change notification settings - Fork 100
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
Filter logging to hide massive stacktrace for access issue #857
Conversation
Deploying datachain-documentation with Cloudflare Pages
|
@@ -23,6 +24,10 @@ | |||
|
|||
D = TypeVar("D", bound="DataChain") | |||
|
|||
# Disable warnings for remote errors in clients | |||
logging.getLogger("aiobotocore.credentials").setLevel(logging.CRITICAL) |
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.
how does logger settings affect stack traces?
I think the idea is not swallow things, but probably wrap into more meaningful messages / exceptions when possible. |
It doesn't swallow things but just disables the warnings or errors even when the exception has been raised for example : As a result, even when we capture the exception, we had the stacktrace in the terminal output.
As for the original ask in the issue #600 , we can also print the stacktrace to the debug logger and print one line output if we want. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #857 +/- ##
=======================================
Coverage 87.59% 87.59%
=======================================
Files 128 128
Lines 11382 11385 +3
Branches 1540 1540
=======================================
+ Hits 9970 9973 +3
Misses 1025 1025
Partials 387 387
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@amritghimire okay, I see. thanks! |
With this change, we will return the ClientError without any extra error or logs in the terminal. As a result, if we capture the ClientError in the script, we will have minimum output. Example query: ```python from datachain.error import ClientError from datachain.lib.dc import C, DataChain try: wds = ( DataChain.from_storage("az://amrit-datachain-test/shards") .filter(C.name.glob("00000000.tar")) .settings(parallel=8, cache=True) ) wds.show() except ClientError as e: print(str(e)) print("Exception caught") ``` Closes #600
2094c2c
to
f0723bf
Compare
main > #856 > #857 (this)
With this change, we will return the ClientError without any extra error
or logs in the terminal. As a result, if we capture the ClientError in
the script, we will have minimum output.
Example query:
Before changes:
After changes:
Closes #600