Skip to content

Smart Datasets (🧪Beta)

albert.resources.smart_datasets

SmartDatasetBuildState

Bases: str, Enum

The build state of a smart dataset.

Attributes:

Name Type Description
BUILDING
READY
FAILED

BUILDING

BUILDING = 'building'

READY

READY = 'ready'

FAILED

FAILED = 'failed'

SmartDatasetScope

Bases: BaseAlbertModel

Represents the scope of a smart dataset.

Attributes:

Name Type Description
project_ids list[ProjectId]

List of project IDs.

target_ids list[TargetId]

List of target IDs.

sheet_ids list[WorksheetId] | None

List of worksheet IDs. If None, all worksheets in the projects will be used.

Show JSON schema:
{
  "description": "Represents the scope of a smart dataset.\n\nAttributes\n----------\nproject_ids : list[ProjectId]\n    List of project IDs.\ntarget_ids : list[TargetId]\n    List of target IDs.\nsheet_ids : list[WorksheetId] | None\n    List of worksheet IDs. If None, all worksheets in the projects will be used.",
  "properties": {
    "projectIds": {
      "items": {
        "type": "string"
      },
      "title": "Projectids",
      "type": "array"
    },
    "targetIds": {
      "items": {
        "type": "string"
      },
      "title": "Targetids",
      "type": "array"
    },
    "sheetIds": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Sheetids"
    }
  },
  "title": "SmartDatasetScope",
  "type": "object"
}

Fields:

Validators:

project_ids

project_ids: list[ProjectId]

target_ids

target_ids: list[TargetId]

sheet_ids

sheet_ids: list[WorksheetId] | None = None

filter_invalid_sheet_ids

filter_invalid_sheet_ids(v)
Source code in src/albert/resources/smart_datasets.py
@field_validator("sheet_ids", mode="before")
@classmethod
def filter_invalid_sheet_ids(cls, v):
    if v is None:
        return v
    valid = [sid for sid in v if isinstance(sid, str) and sid.upper().startswith("WKS")]
    return valid or None

SmartDataset

Bases: BaseResource

Represents a smart dataset entity.

Attributes:

Name Type Description
id SmartDatasetId | None

The unique identifier of the smart dataset.

scope SmartDatasetScope | None

The dataset scope containing project, target, and sheet IDs.

schema_ dict | None

The dataset schema.

storage_key str | None

The storage key for the dataset.

type

type: Literal['smart'] = 'smart'

id

id: SmartDatasetId | None = Field(default=None)

build_state

build_state: SmartDatasetBuildState | None = Field(
    default=None, alias="buildState"
)

scope

scope: SmartDatasetScope | None = Field(default=None)

schema_

schema_: dict | None = Field(default=None, alias='schema')

storage_key

storage_key: str | None = Field(
    default=None, alias="storageKey"
)