Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split
Browse files Browse the repository at this point in the history
skshetry committed Jan 9, 2024

Verified

This commit was signed with the committer’s verified signature.
Byron Sebastian Thiel
1 parent fcddfd6 commit 012db26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dvc/api/dataset.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 012db26

Please sign in to comment.