File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -305,6 +305,8 @@ def validate(self) -> None:
305
305
for slot , curator in self ._slots .items ():
306
306
logger .info (f"validating slot { slot } ..." )
307
307
curator .validate ()
308
+ # set _is_validated to True as no slot raised an error
309
+ self ._is_validated = True
308
310
309
311
@doc_args (SAVE_ARTIFACT_DOCSTRING )
310
312
def save_artifact (
Original file line number Diff line number Diff line change @@ -427,7 +427,10 @@ def test_anndata_curator_different_components(small_dataset1_schema: ln.Schema):
427
427
assert isinstance (curator .slots ["uns" ], ln .curators .DataFrameCurator )
428
428
artifact = ln .Artifact .from_anndata (
429
429
adata , key = "examples/dataset1.h5ad" , schema = anndata_schema
430
- ).save ()
430
+ )
431
+ assert artifact ._curator ._is_validated # important test, do not remove
432
+ artifact .save ()
433
+ assert not hasattr (artifact , "_curator" ) # test that curator is deleted
431
434
assert artifact .schema == anndata_schema
432
435
assert artifact .features .slots ["var.T" ].n == 3 # 3 genes get linked
433
436
if add_comp == "obs" :
You can’t perform that action at this time.
0 commit comments