Skip to content

Commit

Permalink
🐛 Deprecate from_public correctly
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <lukas.heumos@posteo.net>
  • Loading branch information
Zethson committed Oct 23, 2024
1 parent c058b30 commit 60bb2ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bionty/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,13 @@ def from_source(
else:
return results

# deprecated
from lamindb_setup.core._deprecated import deprecated

@deprecated(".from_source()")
@classmethod
def from_public(cls, *args, **kwargs) -> BioRecord | list[BioRecord] | None:
"""Create a record or records from public reference based on a single field value.
""":meta private:
Create a record or records from public reference based on a single field value.
Notes:
For more info, see tutorial :doc:`docs:bionty`
Expand All @@ -450,9 +453,7 @@ def from_public(cls, *args, **kwargs) -> BioRecord | list[BioRecord] | None:
Create a record by passing a field value:
>>> record = bionty.Gene.from_public(symbol="TCF7", organism="human")
"""
logger.warning("`.from_public()` is deprecated, use `.from_source()`!'")
return cls.from_source(*args, **kwargs)

def save(self, *args, **kwargs) -> BioRecord:
Expand Down

0 comments on commit 60bb2ba

Please sign in to comment.