Transfer artifacts from a local instance to a cloud instance¶
import lamindb as ln
import bionty as bt
ln.connect("laminlabs/lamin-dev")
bt.settings.organism = "human"
→ connected lamindb: laminlabs/lamin-dev
artifact = ln.Artifact.using("testuser1/test-transfer-to-cloud").get(
description="test-transfer-to-cloud"
)
artifact.describe()
Artifact .parquet · DataFrame · dataset ├── General │ ├── uid: 2QIrrgcL3VV4u1Ja0000 hash: kBD-Hkm5bY3IAXR2FFiydA │ ├── size: 1.5 KB n_observations: 3 │ ├── space: all branch: main │ ├── created_at: 2025-07-15 14:31:26 created_by: testuser1 (Test User1) │ ├── storage location / path: │ │ /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/.lamindb/2QIrrgcL3VV4u1Ja0000.parquet │ └── description: test-transfer-to-cloud ├── Dataset features │ └── var • 2 [bionty.CellMarker] │ PD1 num │ CD21 num └── Labels └── .organisms bionty.Organism human .experiments wetlab.Experiment experiment-test-transfer-to-cloud
artifact.save(transfer="annotations")
! no run & transform got linked, call `ln.track()` & re-run
→ returning existing schema with same hash: Schema(uid='4UIpHeuxKfOTiRPq', n=2, is_type=False, itype='bionty.CellMarker', dtype='num', hash='ygZEOY-P2mQUntYonTjRVg', minimal_set=True, ordered_set=False, maximal_set=False, branch_id=1, space_id=1, created_by_id=2, created_at=2025-05-03 21:37:21 UTC)
→ mapped: Organism(uid='1dpCL6Td')
→ transferred: Artifact(uid='2QIrrgcL3VV4u1Ja0000'), Experiment(uid='PMTOlJ3Y')
Artifact(uid='2QIrrgcL3VV4u1Ja0000', is_latest=True, description='test-transfer-to-cloud', suffix='.parquet', kind='dataset', otype='DataFrame', size=1568, hash='kBD-Hkm5bY3IAXR2FFiydA', n_observations=3, branch_id=1, space_id=1, storage_id=3, run_id=178, created_by_id=2, created_at=2025-07-15 14:31:26 UTC)
artifact.describe()
Artifact .parquet · DataFrame · dataset ├── General │ ├── uid: 2QIrrgcL3VV4u1Ja0000 hash: kBD-Hkm5bY3IAXR2FFiydA │ ├── size: 1.5 KB n_observations: 3 │ ├── space: all branch: main │ ├── created_at: 2025-07-15 14:31:26 created_by: testuser1 (Test User1) │ ├── storage location / path: │ │ /home/runner/work/lamindb/lamindb/docs/storage/test-transfer-to-cloud/.lamindb/2QIrrgcL3VV4u1Ja0000.parquet │ ├── description: test-transfer-to-cloud │ └── transform: __lamindb_transfer__/5rYQ1DZky2qU ├── Dataset features │ └── var • 2 [bionty.CellMarker] │ CD21 num │ PD1 num └── Labels └── .organisms bionty.Organism human .experiments wetlab.Experiment experiment-test-transfer-to-cloud
assert artifact._state.db == "default"
assert artifact.organisms.get().name == "human"
assert artifact.experiments.get().name == "experiment-test-transfer-to-cloud"
assert artifact.features["var"].count() == 2
/tmp/ipykernel_2934/1699649831.py:4: FutureWarning: Use slots[slot].members instead of __getitem__, __getitem__ will be removed in the future.
assert artifact.features["var"].count() == 2