You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
b2sdk: create_file prioritization should accept an enum, not a string #602
Bucket.create_file and Bucket.create_file_stream accept source prioritization as a string, with the supported values being local, remote and local_verification. An enum would make the valid values discoverable through the type system and turn a typo into an immediate error rather than a silently different plan.
This was recorded as a .. TODO:: directive in doc/source/advanced.rst, where it was invisible in published builds and carried no owner or acceptance criteria. It is tracked here instead, as part of #601.
Note that this is an API design change rather than a documentation change, so it is filed separately from the documentation work in #601.
Steps to reproduce
bucket.create_file(input_sources, remote_name, file_info, prioritize='local')
bucket.create_file(input_sources, remote_name, file_info, prioritize='locol') # typo, not rejected at the call site
Expected behavior
Prioritization should be expressed as an enum, with the string values continuing to be accepted for backwards compatibility within the current interface version.
Actual behavior
Only strings are accepted, and an unrecognised value is not caught at the call site.
Activity