dataset
dataset ¶
Dataset route module - re-exports all dataset functionality.
UploadDataError ¶
UploadDataError(
stage_num: int,
dataset_id: str,
res: ResponseGetData,
message: str | None = None,
)
Bases: RouteError
raise if unable to upload data to Domo
Source code in src/crew_dcs/routes/dataset/exceptions.py
54 55 56 57 58 59 60 61 62 63 | |
alter_schema
async
¶
alter_schema(
auth: DomoAuth,
schema_obj: dict,
dataset_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
alters the schema for a dataset BUT DOES NOT ALTER THE DESCRIPTION
Source code in src/crew_dcs/routes/dataset/schema.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
alter_schema_descriptions
async
¶
alter_schema_descriptions(
auth: DomoAuth,
schema_obj: dict,
dataset_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
alters the description of the schema columns // as seen in DataCenter > Dataset > Schema
Source code in src/crew_dcs/routes/dataset/schema.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
create_semantic_model
async
¶
create_semantic_model(
auth: DomoAuth,
data_source_name: str,
schema: dict,
*,
data_source_description: str | None = None,
cloud_id: str = "domo",
body: dict | None = None,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Create a new data model (POST /api/query/v1/semantic-models).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
data_source_name
|
str
|
Model display name |
required |
schema
|
dict
|
The model definition: |
required |
data_source_description
|
str | None
|
Optional model description |
None
|
cloud_id
|
str
|
Cloud engine ID (defaults to "domo") |
'domo'
|
body
|
dict | None
|
Fully pre-built payload; overrides the generated envelope |
None
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData containing the new model's |
Note
The Domo API has a validation bug where non-primary relationships
require a non-null alias field but rejects all string values for it.
The workaround is to set primary=True for all relationships in the
schema. The DataModelTemplate.to_schema() method preserves whatever
primary values are set on the relationships.
Source code in src/crew_dcs/routes/dataset/dataset_views.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
delete_partition_stage_1
async
¶
delete_partition_stage_1(
auth: DomoAuth,
dataset_id: str,
dataset_partition_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
)
Delete partition has 3 stages
Stage 1. This marks the data version associated with the partition tag as deleted.¶
It does not delete the partition tag or remove the association between the partition tag and data version. There should be no need to upload an empty file - step #3 will remove the data from Adrenaline.
update on 9/9/2022 based on the conversation with Greg Swensen¶
Source code in src/crew_dcs/routes/dataset/core.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
delete_partition_stage_2
async
¶
delete_partition_stage_2(
auth: DomoAuth,
dataset_id: str,
dataset_partition_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
)
This will remove the partition association so that it doesn't show up in the list call. Technically, this is not required as a partition against a deleted data version will not count against the 400 partition limit but as the current partitions api doesn't make that clear, cleaning these up will make it much easier for you to manage.
Source code in src/crew_dcs/routes/dataset/core.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
generate_schema_from_dataframe ¶
generate_schema_from_dataframe(
df: DataFrame,
upsert_key: str | None = None,
column_types: dict[str, str] | None = None,
) -> dict
Generate a Domo schema dict from a pandas DataFrame.
Maps pandas dtypes to Domo schema column types: object/bool -> STRING, integer -> LONG, float -> DOUBLE, datetime -> DATETIME.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
pandas DataFrame to analyze |
required |
upsert_key
|
str | None
|
Column name to mark as the identity/upsert column |
None
|
column_types
|
dict[str, str] | None
|
Override mapping {column_name: "STRING"|"LONG"|"DOUBLE"|"DATE"|"DATETIME"} |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
{"columns": [{"name": "...", "type": "...", "upsertKey": bool}, ...]} |
Source code in src/crew_dcs/routes/dataset/convenience.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
generate_share_dataset_payload ¶
generate_share_dataset_payload(
entity_type: str,
entity_id: str,
access_level: ShareDataset_AccessLevelEnum = CAN_SHARE,
is_send_email: bool = False,
) -> dict
Generate payload for sharing a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_type
|
str
|
Type of entity (USER or GROUP) |
required |
entity_id
|
str
|
ID of the user or group |
required |
access_level
|
ShareDataset_AccessLevelEnum
|
Access level (ShareDataset_AccessLevelEnum enum). Defaults to CAN_SHARE. |
CAN_SHARE
|
is_send_email
|
bool
|
Whether to send email notification |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary payload for dataset sharing API |
Source code in src/crew_dcs/routes/dataset/sharing.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_dataset_by_id
async
¶
get_dataset_by_id(
dataset_id: str,
auth: DomoAuth | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
retrieve dataset metadata
Source code in src/crew_dcs/routes/dataset/core.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
get_dataset_view_schema_indexed
async
¶
get_dataset_view_schema_indexed(
auth: DomoAuth,
dataset_id: str,
include_data_control_column_details: bool = True,
flatten: bool | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Get the indexed schema for a dataset view with optional data control column details.
This endpoint returns the schema structure for a dataset view, including: - Column definitions with types and visibility - SELECT query structure - View template information - Data control column details (if requested)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
dataset_id
|
str
|
The dataset view ID |
required |
include_data_control_column_details
|
bool
|
If True, includes data control column details |
True
|
flatten
|
bool | None
|
If False, preserves per-table join structure (required to get a
data model's |
None
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing: |
ResponseGetData
|
|
ResponseGetData
|
|
ResponseGetData
|
|
ResponseGetData
|
|
ResponseGetData
|
|
ResponseGetData
|
|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Dataset_GET_Error
|
If schema retrieval fails |
Source code in src/crew_dcs/routes/dataset/dataset_views.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
get_datasets_by_ids
async
¶
get_datasets_by_ids(
auth: DomoAuth,
dataset_ids: list[str],
include_private: bool = True,
include_all_details: bool = True,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Fetch metadata for many datasources at once.
POST /api/data/v3/datasources/bulk (body = list of dataset ids). The API
returns {"dataSources": [...], "_metaData": {...}}; unless return_raw
is set, res.response is unwrapped to the dataSources list.
Source code in src/crew_dcs/routes/dataset/core.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
get_permissions
async
¶
get_permissions(
auth: DomoAuth,
dataset_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
retrieve the schema for a dataset
Source code in src/crew_dcs/routes/dataset/sharing.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
get_schema
async
¶
get_schema(
auth: DomoAuth,
dataset_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
retrieve the schema for a dataset
Source code in src/crew_dcs/routes/dataset/schema.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
index_dataset
async
¶
index_dataset(
auth: DomoAuth,
dataset_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
manually index a dataset
Source code in src/crew_dcs/routes/dataset/upload.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
index_status
async
¶
index_status(
auth: DomoAuth,
dataset_id: str,
index_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
get the completion status of an index
Source code in src/crew_dcs/routes/dataset/upload.py
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
list_partitions
async
¶
list_partitions(
auth: DomoAuth,
dataset_id: str,
body: dict | None = None,
debug_loop: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
List all partitions for a dataset.
Source code in src/crew_dcs/routes/dataset/upload.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | |
query_dataset_public
async
¶
query_dataset_public(
dev_auth: DomoDeveloperAuth,
dataset_id: str,
sql: str,
*,
context: RouteContext | None = None,
**context_kwargs
)
query for hitting public apis, requires client_id and secret authentication
Source code in src/crew_dcs/routes/dataset/query.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
search_datasets
async
¶
search_datasets(
auth: DomoAuth,
search_text: str | None = None,
maximum: int | None = None,
data_provider_type: str | None = None,
tags: list[str] | str | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Search for datasets by name, data provider, and/or tags.
Uses the datacenter search API to find datasets matching the search criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
search_text
|
str | None
|
Optional text to search for in dataset names (wildcards supported) |
None
|
maximum
|
int | None
|
Maximum number of results to return |
None
|
data_provider_type
|
str | None
|
Optional dataset provider type filter |
None
|
tags
|
list[str] | str | None
|
Optional tag filter(s) — a single tag string or a list of tag strings.
Each tag generates a |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing list of matching datasets |
Raises:
| Type | Description |
|---|---|
Dataset_GET_Error
|
If search operation fails |
Source code in src/crew_dcs/routes/dataset/core.py
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | |
set_dataset_tags
async
¶
set_dataset_tags(
auth: DomoAuth,
tag_ls: list[str],
dataset_id: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
REPLACE tags on this dataset with a new list
Source code in src/crew_dcs/routes/dataset/schema.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
update_dataset_properties
async
¶
update_dataset_properties(
auth: DomoAuth,
dataset_id: str,
name: str | None = None,
description: str | None = None,
body: dict | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Update a datasource's name and/or description.
PUT /api/data/v3/datasources/{dataset_id}/properties
Source code in src/crew_dcs/routes/dataset/core.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
update_semantic_model
async
¶
update_semantic_model(
auth: DomoAuth,
model_id: str,
schema: dict,
*,
data_source_name: str | None = None,
data_source_description: str | None = None,
last_updated: str | None = None,
cloud_id: str = "domo",
can_edit: bool = True,
body: dict | None = None,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Update a data model (PUT /api/query/v1/semantic-models/{model_id}).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
model_id
|
str
|
The data model (semantic model) datasource ID |
required |
schema
|
dict
|
The model definition: |
required |
data_source_name
|
str | None
|
Model display name |
None
|
data_source_description
|
str | None
|
Model description |
None
|
last_updated
|
str | None
|
ISO-8601 last-updated timestamp echoed back to the API |
None
|
cloud_id
|
str
|
Cloud engine ID (defaults to "domo") |
'domo'
|
can_edit
|
bool
|
Whether the caller can edit (defaults to True) |
True
|
body
|
dict | None
|
Fully pre-built payload; overrides the generated envelope |
None
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Source code in src/crew_dcs/routes/dataset/dataset_views.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
update_view
async
¶
update_view(
auth: DomoAuth,
view_id: str,
schema: dict,
*,
data_source_name: str | None = None,
trigger: dict | None = None,
data_provider_type: str | None = None,
body: dict | None = None,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Update a dataset view's definition (PUT /api/query/v1/views/{view_id}).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
view_id
|
str
|
The dataset view ID |
required |
schema
|
dict
|
The view schema payload (tables + viewTemplate + tableAliases).
Typically a (possibly edited) |
required |
data_source_name
|
str | None
|
View display name |
None
|
trigger
|
dict | None
|
Refresh trigger config (defaults to |
None
|
data_provider_type
|
str | None
|
Data provider type (usually None for views) |
None
|
body
|
dict | None
|
Fully pre-built payload; overrides the generated envelope |
None
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Source code in src/crew_dcs/routes/dataset/dataset_views.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
upload_dataframe
async
¶
upload_dataframe(
auth: DomoAuth,
dataset_name: str,
df: DataFrame,
*,
schema: dict | None = None,
upsert_key: str | None = None,
column_types: dict[str, str] | None = None,
update_method: str = "REPLACE",
is_index: bool = True,
is_create_if_not_exists: bool = True,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Upload a DataFrame to Domo in one call.
If the dataset doesn't exist, creates it with an auto-detected schema. If it does exist, amends the schema for any new DataFrame columns before uploading.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
dataset_name
|
str
|
Name of the dataset to find or create |
required |
df
|
DataFrame
|
DataFrame to upload |
required |
schema
|
dict | None
|
Explicit schema override used when creating a new dataset |
None
|
upsert_key
|
str | None
|
Column name to mark as the identity/upsert column |
None
|
column_types
|
dict[str, str] | None
|
Override auto-detected types for specific columns |
None
|
update_method
|
str
|
"REPLACE" or "APPEND" |
'REPLACE'
|
is_index
|
bool
|
Whether to index the dataset after uploading |
True
|
is_create_if_not_exists
|
bool
|
Create the dataset if no match is found by name |
True
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData from the upload commit, with |
Raises:
| Type | Description |
|---|---|
DatasetNotFoundError
|
If no dataset matches and is_create_if_not_exists is False |
Source code in src/crew_dcs/routes/dataset/convenience.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
upload_dataset_stage_1
async
¶
upload_dataset_stage_1(
auth: DomoAuth,
dataset_id: str,
partition_tag: str | None = None,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
preps dataset for upload by creating an upload_id (upload session key) pass to stage 2 as a parameter
Source code in src/crew_dcs/routes/dataset/upload.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
upload_dataset_stage_2_df
async
¶
upload_dataset_stage_2_df(
auth: DomoAuth,
dataset_id: str,
upload_id: str,
upload_df: DataFrame,
part_id: int = 2,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Upload pandas DataFrame to dataset (stage 2 of upload process).
Source code in src/crew_dcs/routes/dataset/upload.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
upload_dataset_stage_2_file
async
¶
upload_dataset_stage_2_file(
auth: DomoAuth,
dataset_id: str,
upload_id: str,
data_file: TextIOWrapper | None = None,
part_id: int = 2,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Upload data file to dataset (stage 2 of upload process).
Source code in src/crew_dcs/routes/dataset/upload.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
upload_dataset_stage_3
async
¶
upload_dataset_stage_3(
auth: DomoAuth,
dataset_id: str,
upload_id: str,
update_method: str = "REPLACE",
partition_tag: str | None = None,
is_index: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
commit will close the upload session, upload_id. this request defines how the data will be loaded into Adrenaline, update_method has optional flag for indexing dataset.
Source code in src/crew_dcs/routes/dataset/upload.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |