Skip to content

Commit

Permalink
feat(breadbox): Added new fields to dataset for use in filtering/sele…
Browse files Browse the repository at this point in the history
…ction (#123)

* Added new fields to dataset for use in filtering/selection

Specifically added:
 - short_name
 - version
 - description

* updated client

* fixed pyright errors
  • Loading branch information
pgm authored Nov 6, 2024
1 parent f0d3141 commit bf8da41
Show file tree
Hide file tree
Showing 19 changed files with 719 additions and 10 deletions.
60 changes: 60 additions & 0 deletions breadbox-client/breadbox_client/models/matrix_dataset_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ class MatrixDatasetParams:
either be 'csv' or 'parquet' Default: MatrixDatasetParamsDataFileFormat.CSV.
dataset_metadata (Union['MatrixDatasetParamsDatasetMetadataType0', None, Unset]): Contains a dictionary of
additional dataset values that are not already provided above.
description (Union[None, Unset, str]): an optional long description of the dataset
feature_type (Union[None, Unset, str]): Type of features your dataset contains
given_id (Union[None, Unset, str]): Stable human-readable identifier that the portal uses to look up specific
datasets.
is_transient (Union[Unset, bool]): Transient datasets can be deleted - should only be set to true for non-public
short-term-use datasets like custom analysis results. Default: False.
priority (Union[None, Unset, int]): Numeric value assigned to the dataset with `1` being highest priority within
the `data_type`, used for displaying order of datasets to show for a specific `data_type` in UI.
short_name (Union[None, Unset, str]): an optional short label describing dataset
taiga_id (Union[None, Unset, str]): Taiga ID the dataset is sourced from.
version (Union[None, Unset, str]): an optional short version identifier
"""

data_type: str
Expand All @@ -65,11 +68,14 @@ class MatrixDatasetParams:
dataset_metadata: Union["MatrixDatasetParamsDatasetMetadataType0", None, Unset] = (
UNSET
)
description: Union[None, Unset, str] = UNSET
feature_type: Union[None, Unset, str] = UNSET
given_id: Union[None, Unset, str] = UNSET
is_transient: Union[Unset, bool] = False
priority: Union[None, Unset, int] = UNSET
short_name: Union[None, Unset, str] = UNSET
taiga_id: Union[None, Unset, str] = UNSET
version: Union[None, Unset, str] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -116,6 +122,12 @@ def to_dict(self) -> Dict[str, Any]:
else:
dataset_metadata = self.dataset_metadata

description: Union[None, Unset, str]
if isinstance(self.description, Unset):
description = UNSET
else:
description = self.description

feature_type: Union[None, Unset, str]
if isinstance(self.feature_type, Unset):
feature_type = UNSET
Expand All @@ -136,12 +148,24 @@ def to_dict(self) -> Dict[str, Any]:
else:
priority = self.priority

short_name: Union[None, Unset, str]
if isinstance(self.short_name, Unset):
short_name = UNSET
else:
short_name = self.short_name

taiga_id: Union[None, Unset, str]
if isinstance(self.taiga_id, Unset):
taiga_id = UNSET
else:
taiga_id = self.taiga_id

version: Union[None, Unset, str]
if isinstance(self.version, Unset):
version = UNSET
else:
version = self.version

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -163,6 +187,8 @@ def to_dict(self) -> Dict[str, Any]:
field_dict["data_file_format"] = data_file_format
if dataset_metadata is not UNSET:
field_dict["dataset_metadata"] = dataset_metadata
if description is not UNSET:
field_dict["description"] = description
if feature_type is not UNSET:
field_dict["feature_type"] = feature_type
if given_id is not UNSET:
Expand All @@ -171,8 +197,12 @@ def to_dict(self) -> Dict[str, Any]:
field_dict["is_transient"] = is_transient
if priority is not UNSET:
field_dict["priority"] = priority
if short_name is not UNSET:
field_dict["short_name"] = short_name
if taiga_id is not UNSET:
field_dict["taiga_id"] = taiga_id
if version is not UNSET:
field_dict["version"] = version

return field_dict

Expand Down Expand Up @@ -248,6 +278,15 @@ def _parse_dataset_metadata(

dataset_metadata = _parse_dataset_metadata(d.pop("dataset_metadata", UNSET))

def _parse_description(data: object) -> Union[None, Unset, str]:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(Union[None, Unset, str], data)

description = _parse_description(d.pop("description", UNSET))

def _parse_feature_type(data: object) -> Union[None, Unset, str]:
if data is None:
return data
Expand Down Expand Up @@ -277,6 +316,15 @@ def _parse_priority(data: object) -> Union[None, Unset, int]:

priority = _parse_priority(d.pop("priority", UNSET))

def _parse_short_name(data: object) -> Union[None, Unset, str]:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(Union[None, Unset, str], data)

short_name = _parse_short_name(d.pop("short_name", UNSET))

def _parse_taiga_id(data: object) -> Union[None, Unset, str]:
if data is None:
return data
Expand All @@ -286,6 +334,15 @@ def _parse_taiga_id(data: object) -> Union[None, Unset, str]:

taiga_id = _parse_taiga_id(d.pop("taiga_id", UNSET))

def _parse_version(data: object) -> Union[None, Unset, str]:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(Union[None, Unset, str], data)

version = _parse_version(d.pop("version", UNSET))

matrix_dataset_params = cls(
data_type=data_type,
dataset_md5=dataset_md5,
Expand All @@ -299,11 +356,14 @@ def _parse_taiga_id(data: object) -> Union[None, Unset, str]:
allowed_values=allowed_values,
data_file_format=data_file_format,
dataset_metadata=dataset_metadata,
description=description,
feature_type=feature_type,
given_id=given_id,
is_transient=is_transient,
priority=priority,
short_name=short_name,
taiga_id=taiga_id,
version=version,
)

matrix_dataset_params.additional_properties = d
Expand Down
60 changes: 60 additions & 0 deletions breadbox-client/breadbox_client/models/matrix_dataset_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ class MatrixDatasetResponse:
units (str):
value_type (ValueType):
dataset_md5 (Union[None, Unset, str]):
description (Union[None, Unset, str]): an optional long description of the dataset
format_ (Union[Unset, MatrixDatasetResponseFormat]): Default: MatrixDatasetResponseFormat.MATRIX_DATASET.
given_id (Union[None, Unset, str]):
is_transient (Union[Unset, bool]): Default: False.
priority (Union[None, Unset, int]):
short_name (Union[None, Unset, str]): an optional short label describing dataset
taiga_id (Union[None, Unset, str]):
version (Union[None, Unset, str]): an optional short version identifier
"""

allowed_values: Union[List[str], None]
Expand All @@ -61,13 +64,16 @@ class MatrixDatasetResponse:
units: str
value_type: ValueType
dataset_md5: Union[None, Unset, str] = UNSET
description: Union[None, Unset, str] = UNSET
format_: Union[Unset, MatrixDatasetResponseFormat] = (
MatrixDatasetResponseFormat.MATRIX_DATASET
)
given_id: Union[None, Unset, str] = UNSET
is_transient: Union[Unset, bool] = False
priority: Union[None, Unset, int] = UNSET
short_name: Union[None, Unset, str] = UNSET
taiga_id: Union[None, Unset, str] = UNSET
version: Union[None, Unset, str] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -113,6 +119,12 @@ def to_dict(self) -> Dict[str, Any]:
else:
dataset_md5 = self.dataset_md5

description: Union[None, Unset, str]
if isinstance(self.description, Unset):
description = UNSET
else:
description = self.description

format_: Union[Unset, str] = UNSET
if not isinstance(self.format_, Unset):
format_ = self.format_.value
Expand All @@ -131,12 +143,24 @@ def to_dict(self) -> Dict[str, Any]:
else:
priority = self.priority

short_name: Union[None, Unset, str]
if isinstance(self.short_name, Unset):
short_name = UNSET
else:
short_name = self.short_name

taiga_id: Union[None, Unset, str]
if isinstance(self.taiga_id, Unset):
taiga_id = UNSET
else:
taiga_id = self.taiga_id

version: Union[None, Unset, str]
if isinstance(self.version, Unset):
version = UNSET
else:
version = self.version

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -156,6 +180,8 @@ def to_dict(self) -> Dict[str, Any]:
)
if dataset_md5 is not UNSET:
field_dict["dataset_md5"] = dataset_md5
if description is not UNSET:
field_dict["description"] = description
if format_ is not UNSET:
field_dict["format"] = format_
if given_id is not UNSET:
Expand All @@ -164,8 +190,12 @@ def to_dict(self) -> Dict[str, Any]:
field_dict["is_transient"] = is_transient
if priority is not UNSET:
field_dict["priority"] = priority
if short_name is not UNSET:
field_dict["short_name"] = short_name
if taiga_id is not UNSET:
field_dict["taiga_id"] = taiga_id
if version is not UNSET:
field_dict["version"] = version

return field_dict

Expand Down Expand Up @@ -244,6 +274,15 @@ def _parse_dataset_md5(data: object) -> Union[None, Unset, str]:

dataset_md5 = _parse_dataset_md5(d.pop("dataset_md5", UNSET))

def _parse_description(data: object) -> Union[None, Unset, str]:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(Union[None, Unset, str], data)

description = _parse_description(d.pop("description", UNSET))

_format_ = d.pop("format", UNSET)
format_: Union[Unset, MatrixDatasetResponseFormat]
if isinstance(_format_, Unset):
Expand Down Expand Up @@ -271,6 +310,15 @@ def _parse_priority(data: object) -> Union[None, Unset, int]:

priority = _parse_priority(d.pop("priority", UNSET))

def _parse_short_name(data: object) -> Union[None, Unset, str]:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(Union[None, Unset, str], data)

short_name = _parse_short_name(d.pop("short_name", UNSET))

def _parse_taiga_id(data: object) -> Union[None, Unset, str]:
if data is None:
return data
Expand All @@ -280,6 +328,15 @@ def _parse_taiga_id(data: object) -> Union[None, Unset, str]:

taiga_id = _parse_taiga_id(d.pop("taiga_id", UNSET))

def _parse_version(data: object) -> Union[None, Unset, str]:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(Union[None, Unset, str], data)

version = _parse_version(d.pop("version", UNSET))

matrix_dataset_response = cls(
allowed_values=allowed_values,
data_type=data_type,
Expand All @@ -293,11 +350,14 @@ def _parse_taiga_id(data: object) -> Union[None, Unset, str]:
units=units,
value_type=value_type,
dataset_md5=dataset_md5,
description=description,
format_=format_,
given_id=given_id,
is_transient=is_transient,
priority=priority,
short_name=short_name,
taiga_id=taiga_id,
version=version,
)

matrix_dataset_response.additional_properties = d
Expand Down
Loading

0 comments on commit bf8da41

Please sign in to comment.