aai-institute / lakefs-spec

An fsspec implementation for the lakeFS project
http://lakefs-spec.org/
Apache License 2.0
39 stars 4 forks source link

Add `exist_ok` flag to all resource-creating client helpers #154

Closed nicholasjng closed 10 months ago

nicholasjng commented 10 months ago

This ensures that usage can be made idempotent, which (for us) has the tangible advantage of allowing for faster docs development iterations.

The heuristic to detect a backend "exists" error is only the status code 409 for now, though we could also do a substring search on the reason. This however would incur a JSON parse.

Changes the tag creation API to return a Ref model object.

The ensure_branch was renamed to create_branch on account of the creation option exist_ok that was added.

Fixes #153.

codecov-commenter commented 10 months ago

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (5637b27) 87.66% compared to head (c37de2c) 87.33%.

Files Patch % Lines
src/lakefs_spec/client_helpers.py 79.31% 3 Missing and 3 partials :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #154 +/- ## ========================================== - Coverage 87.66% 87.33% -0.34% ========================================== Files 7 7 Lines 446 458 +12 Branches 62 65 +3 ========================================== + Hits 391 400 +9 Misses 33 33 - Partials 22 25 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

AdrianoKF commented 10 months ago

Can you add a test case for client_helpers.create_repository? The function is currently not covered by any tests (Codecov)