From d2d7934f02da9d1426dc9746b67928a2acb13795 Mon Sep 17 00:00:00 2001 From: Alex Wolf Date: Mon, 20 Nov 2023 19:04:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Add=20`.df()`=20to=20`Registry`?= =?UTF-8?q?=20(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🚸 Add df to Registry * 💚 Fix --- lnschema_core/models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lnschema_core/models.py b/lnschema_core/models.py index 060142ba..0eaf9f52 100644 --- a/lnschema_core/models.py +++ b/lnschema_core/models.py @@ -439,6 +439,16 @@ def filter(cls, **expressions) -> "QuerySet": return filter(cls, **expressions) + @classmethod + def df(cls) -> "pd.DataFrame": + """Convert to `DataFrame`. + + Warning: This will run a long time on large registries. + """ + from lamindb._filter import filter + + return filter(cls).df() + @classmethod def search( cls,