Description
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.
Environment
- Python version: Any supported version
- b2sdk version:
master at f3ab7b71
- OS: Any
Description
Bucket.create_fileandBucket.create_file_streamaccept source prioritization as a string, with the supported values beinglocal,remoteandlocal_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 indoc/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
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.
Environment
masteratf3ab7b71