-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add custom error message for using crc32c without crt #2905
Conversation
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## develop #2905 +/- ##
========================================
Coverage 93.54% 93.55%
========================================
Files 63 63
Lines 13519 13521 +2
========================================
+ Hits 12647 12650 +3
+ Misses 872 871 -1
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
Looks good to me! 🚀
if algorithm_name == "crc32c" and not HAS_CRT: | ||
raise FlexibleChecksumError( | ||
error_msg=( | ||
"Using CRC32C requires an additional dependency. You will " | ||
"need to pip install botocore[crt] before proceeding." | ||
) | ||
) |
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.
This should be a MissingDependencyError not a FlexibleChecksumError to stay consistent with our CRT exception messaging. See here for an example.
We also want to avoid hardcoding this for one algorithm. We should be able to have a defined list of algorithms supported by the CRT and check against that.
if algorithm_name not in supported_algorithms:
if not HAS_CRT and algorithm_name in crt_algorithms:
raise MissingDependencyError(
error_msg=(
f"Using {algorithm_name} requires an additional dependency. "
f"You will need to pip install botocore[crt] before proceeding."
)
)
raise FlexibleChecksumError(
error_msg="Unsupported checksum algorithm: %s" % algorithm_name
)
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.
Ok I can open a followup PR. My only question is should CRC32
be included in crt_algorithms
? Wondering because we have an implementation with and without the CRT.
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.
Everything we support in the CRT can be in the list. We should assert that the dictionary keys we generate here are all in the list to keep everything in sync.
* release-1.29.111: Bumping version to 1.29.111 Update to latest partitions and endpoints Update to latest models add custom error message for using crc32c without crt (#2905)
Adds a custom error message for customers trying to use
CRC32C
checksum algorithm, but don't haveawscrt
installed.