From 012db26446df0c06403ceccd17564f30cc956bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Fri, 15 Dec 2023 18:29:19 +0545 Subject: [PATCH] split --- dvc/api/dataset.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dvc/api/dataset.py b/dvc/api/dataset.py index 9e193f105af..489f6cc5a73 100644 --- a/dvc/api/dataset.py +++ b/dvc/api/dataset.py @@ -22,11 +22,13 @@ def _get_datasets() -> Dict[str, Dict[str, Any]]: def _get_raw(name: str) -> Dict[str, Any]: - return _get_datasets()[name] + datasets = _get_datasets() + return datasets[name] def get(cls: "Type[T]", name: str) -> "T": from pydantic import TypeAdapter d = _get_raw(name) - return TypeAdapter(cls).validate_python(d) + t = TypeAdapter(cls) + return t.validate_python(d)