lamindb 0.77.0__py3-none-any.whl → 0.77.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
lamindb/__init__.py CHANGED
@@ -43,7 +43,7 @@ Modules and settings.
43
43
  """
44
44
 
45
45
  # denote a release candidate for 0.1.0 with 0.1rc1, 0.1a1, 0.1b1, etc.
46
- __version__ = "0.77.0"
46
+ __version__ = "0.77.2"
47
47
 
48
48
  import os as _os
49
49
 
lamindb/_artifact.py CHANGED
@@ -28,6 +28,7 @@ from lnschema_core.types import (
28
28
  VisibilityChoice,
29
29
  )
30
30
 
31
+ from ._parents import view_lineage
31
32
  from ._utils import attach_func_to_class_method
32
33
  from .core._data import (
33
34
  _track_run_input,
@@ -36,7 +37,6 @@ from .core._data import (
36
37
  get_run,
37
38
  save_feature_set_links,
38
39
  save_feature_sets,
39
- view_lineage,
40
40
  )
41
41
  from .core._settings import settings
42
42
  from .core.exceptions import IntegrityError, InvalidArgument
@@ -615,11 +615,14 @@ def __init__(artifact: Artifact, *args, **kwargs):
615
615
 
616
616
  init_self_from_db(artifact, kwargs_or_artifact)
617
617
  # adding "key" here is dangerous because key might be auto-populated
618
- update_attributes(artifact, {"description": description})
619
- if artifact.key != key and key is not None:
618
+ attr_to_update = {"description": description}
619
+ if kwargs_or_artifact._key_is_virtual and kwargs_or_artifact.key is None:
620
+ attr_to_update["key"] = key
621
+ elif artifact.key != key and key is not None:
620
622
  logger.warning(
621
623
  f"key {artifact.key} on existing artifact differs from passed key {key}"
622
624
  )
625
+ update_attributes(artifact, attr_to_update)
623
626
  return None
624
627
  else:
625
628
  kwargs = kwargs_or_artifact
lamindb/_can_curate.py CHANGED
@@ -20,6 +20,8 @@ if TYPE_CHECKING:
20
20
  from lamin_utils._inspect import InspectResult
21
21
  from lnschema_core.types import ListLike, StrField
22
22
 
23
+ from lamindb._query_set import RecordList
24
+
23
25
 
24
26
  # from_values doesn't apply for QuerySet or Manager
25
27
  @classmethod # type:ignore
@@ -32,7 +34,7 @@ def from_values(
32
34
  organism: Record | str | None = None,
33
35
  source: Record | None = None,
34
36
  mute: bool = False,
35
- ) -> list[Record]:
37
+ ) -> RecordList:
36
38
  """{}""" # noqa: D415
37
39
  from_source = True if cls.__module__.startswith("bionty.") else False
38
40
 
lamindb/_collection.py CHANGED
@@ -21,6 +21,7 @@ from lnschema_core.models import (
21
21
  from lnschema_core.types import VisibilityChoice
22
22
 
23
23
  from . import Artifact, Run
24
+ from ._parents import view_lineage
24
25
  from ._record import init_self_from_db, update_attributes
25
26
  from ._utils import attach_func_to_class_method
26
27
  from .core._data import (
@@ -30,7 +31,6 @@ from .core._data import (
30
31
  get_run,
31
32
  save_feature_set_links,
32
33
  save_feature_sets,
33
- view_lineage,
34
34
  )
35
35
  from .core._mapped_collection import MappedCollection
36
36
  from .core._settings import settings