b2sdk: create_file prioritization should accept an enum, not a string
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 22/100
Rechercherichtung
Start with Bucket.create_file and Bucket.create_file_stream in the b2sdk bucket module, and the .. TODO:: note in doc/source/advanced.rst that describes the current string values local, remote and local_verification. The design choices are open: the enum's member names, how strings stay accepted for backwards compatibility, and what an unknown value should raise. Settle those with a maintainer before coding. Done means both methods take the enum, the string values still work, and the typo case in the reproduction fails at the call site.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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:
masteratf3ab7b71 - OS: Any
- Vorherrschende Sprache
- Python
- Sterne
- 214
- Forks
- 68
- Ø Merge
- 51 Min.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Backblaze/b2-sdk-python
-
Download and copy sync actions print remote file names without escape_control_charsEvtl. vergeben @dreyfus92 hat das vor 15 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Backblaze/b2-sdk-python#631 ·
Maintainer antworten meist innerhalb von 1 Tag
-
SqliteAccountInfo profile name validation uses "re.match", so only the first character is checkedEvtl. vergeben @nazarli-shabnam hat das vor 9 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Backblaze/b2-sdk-python#629 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Adopt the AI-native SDLC and repository policiesEvtl. vergeben @goanpeca hat das vor 18 Tagen übernommen. Offenenhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
Backblaze/b2-sdk-python#634 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 50/100
Backblaze/b2-sdk-python#630 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ci: cli-compat fails — 4 sse/sync integration tests broken in B2_Command_Line_Tool (all environments)Evtl. wieder frei @ffumero2003 hat das vor 37 Tagen übernommen, und es ist kein Pull Request offen. Offenbug testing
Backblaze/b2-sdk-python#627 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in Backblaze/b2-sdk-python
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
btclib-org/btclib-node#2505 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
open-webui/open-webui#34462 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
gorakhargosh/watchdog#1462 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
openwisp/openwisp-monitoring#889 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
IETF-Hackathon/pqc-certificates#351 ·
Maintainer antworten meist innerhalb von 2 Tagen