-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from pcattori/dataset-types
Move dataset types into _types/dataset.py
- Loading branch information
Showing
9 changed files
with
60 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional, Tuple, Union | ||
|
||
from tamr_client._types.url import URL | ||
|
||
|
||
@dataclass(frozen=True) | ||
class Dataset: | ||
"""A Tamr dataset | ||
See https://docs.tamr.com/reference/dataset-models | ||
Args: | ||
url: The canonical dataset-based URL for this dataset e.g. `/datasets/1` | ||
name | ||
key_attribute_names | ||
description | ||
""" | ||
|
||
url: URL | ||
name: str | ||
key_attribute_names: Tuple[str, ...] | ||
description: Optional[str] = None | ||
|
||
|
||
@dataclass(frozen=True) | ||
class UnifiedDataset: | ||
"""A Tamr unified dataset | ||
See https://docs.tamr.com/reference/dataset-models | ||
Args: | ||
url: The project-based alias for this dataset e.g. `/projects/1/unifiedDataset` | ||
name | ||
key_attribute_names | ||
description | ||
""" | ||
|
||
url: URL | ||
name: str | ||
key_attribute_names: Tuple[str, ...] | ||
description: Optional[str] = None | ||
|
||
|
||
AnyDataset = Union[Dataset, UnifiedDataset] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
from tamr_client.dataset import dataframe, record, unified | ||
from tamr_client.dataset.dataset import AnyDataset, Dataset | ||
from tamr_client.dataset.dataset import from_resource_id | ||
from tamr_client.dataset.dataset import NotFound | ||
from tamr_client.dataset._dataset import from_resource_id, NotFound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters