Skip to content
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

Implement more APIs in terms of lakefs abstractions #240

Merged
merged 13 commits into from
Dec 28, 2023
Merged

Conversation

nicholasjng
Copy link
Collaborator

Contains implementations for ls, exists, info, cp(_file), rm(_file).

Residual test failures are because the LakeFSFile has not been migrated yet.

maxmynter and others added 8 commits December 27, 2023 17:03
...for `get_file` and `put_file`. Now those methods are truly deferring
to their respective superclass methods after the client-side hash check.
Saves an API call by using `WritableObject.copy()` on the resulting
object.

What remains TBD is whether you can copy files from a reference - the
destination seems to always be a branch.
This was causing test failures, so we just defer to the base class now.
Simplifies the code considerably. Unfortunately, it is not yet clear how
to list files from commits or tags, since those need different reference
abstractions.

This is left as a followup for the time being.
The methods are available on the base classes, which means they should
be able to be used instead of distinct branch names.

However, test coverage might need to be improved, as I do not recall
implementing a test for a commit input on any `stat`-like API.Use `lakefs.Reference`s everywhere for object infos

The methods are available on the base classes, which means they should
be able to be used instead of distinct branch names.

However, test coverage might need to be improved, as I do not recall
implementing a test for a commit input on any `stat`-like API.
They are distinct types from the lakeFS SDK, so we need to migrate the
translator function.
@nicholasjng nicholasjng self-assigned this Dec 27, 2023
Since the vital methods needed for transactions were only included in
v0.2.0, this change incurs a mandatory upgrade to lakefs v0.2.0.

The implicit branch creation is included in the `mode != "rb"` branch
in `fs._open()`.

The migration required the overload of `tail()`, since the `Reader` and
`Writer` do not have a size attribute.
Since we do not inherit from `AbstractBufferedFile` any longer, including
the tests makes no sense.
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

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

Comparison is base (c759691) 91.19% compared to head (b4059a1) 93.34%.

Files Patch % Lines
src/lakefs_spec/spec.py 94.23% 2 Missing and 1 partial ⚠️
src/lakefs_spec/transaction.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
+ Coverage   91.19%   93.34%   +2.15%     
==========================================
  Files           5        5              
  Lines         477      406      -71     
  Branches       82       68      -14     
==========================================
- Hits          435      379      -56     
+ Misses         24       18       -6     
+ Partials       18        9       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This has been superseded by `fs.open()`, which has pre-sign support for
uploads implemented through urllib3.
Those errors are all caught in `lakefs`, which uses a custom translator.

Hence, we can expect to only get `ServerException`s from SDK functions.
@nicholasjng nicholasjng merged commit 5479365 into main Dec 28, 2023
@nicholasjng nicholasjng deleted the sdk-cleanups branch December 28, 2023 20:39
This was referenced Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants