Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

✨ Add replace and stage for File #149

Merged
merged 5 commits into from
Apr 3, 2023
Merged

✨ Add replace and stage for File #149

merged 5 commits into from
Apr 3, 2023

Conversation

Koncopd
Copy link
Member

@Koncopd Koncopd commented Apr 2, 2023

subj

@Koncopd Koncopd changed the title ✨ Replace data for File ✨ Add replace and stage for File Apr 2, 2023
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

@github-actions github-actions bot temporarily deployed to pull request April 2, 2023 13:46 Inactive
@codecov
Copy link

codecov bot commented Apr 2, 2023

Codecov Report

Merging #149 (6dd5059) into main (5e21b4c) will decrease coverage by 2.43%.
The diff coverage is 13.63%.

@@            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     
Impacted Files Coverage Δ
lnschema_core/_core.py 65.47% <13.63%> (-5.68%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -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
Copy link
Member

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:

kwargs, privates = get_file_kwargs_from_data(

Copy link
Member Author

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.

@github-actions github-actions bot temporarily deployed to pull request April 3, 2023 07:11 Inactive
@github-actions github-actions bot temporarily deployed to pull request April 3, 2023 07:44 Inactive
@github-actions github-actions bot temporarily deployed to pull request April 3, 2023 08:37 Inactive
@Koncopd Koncopd merged commit 675f745 into main Apr 3, 2023
@Koncopd Koncopd deleted the replace branch April 3, 2023 12:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants