This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
✨ Add replace and stage for File #149
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #149 +/- ##
==========================================
- Coverage 72.35% 69.92% -2.43%
==========================================
Files 14 14
Lines 510 532 +22
==========================================
+ Hits 369 372 +3
- Misses 141 160 +19
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
falexwolf
reviewed
Apr 3, 2023
lnschema_core/_core.py
Outdated
@@ -451,6 +451,34 @@ def path(self) -> Union[Path, CloudPath]: | |||
"""Path on storage.""" | |||
return filepath_from_file(self) | |||
|
|||
def replace(self, data: Union[Path, str, pd.DataFrame, ad.AnnData], source: Optional[Run] = None, format: Optional[str] = None): | |||
"""Replace data.""" | |||
from lamindb._file import get_path_size_hash, serialize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether one should rather use this here:
lnschema-core/lnschema_core/_core.py
Line 525 in 5e21b4c
kwargs, privates = get_file_kwargs_from_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First i used this, but decided not to to avoid redundant select
for Storage
.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
subj