mstrio > project_objects > helpers

enum mstrio.project_objects.helpers.EnableForAiErrorReason(value)

Bases: Enum

Enumeration of AI enablement error reason codes.

OK (0)

“No error.”

UNKNOWN_ERROR (-1)

“An unknown error occurred.”

EXCEPTION_WRITING_TO_CLICKHOUSE (1)

“An unexpected error occurred while saving data to ClickHouse.”

FAILED_WRITING_TO_CLICKHOUSE (2)

“Failed to write data to ClickHouse.”

ERROR_WHEN_GETTING_SAMPLE_DATA_FROM_CLICKHOUSE (3)

“Failed to retrieve sample data from ClickHouse.”

CUBE_INSTANCE_NOT_FOUND (4)

“Cube instance not found.”

AI_INFORMATION_GENERATION_FAILED (5)

“Failed to generate AI information from the AI service.”

DISK_FULL_IN_CLICKHOUSE (6)

“Failed to write data to ClickHouse due to disk full.”

ERR_GENERAL (100)

“An unspecified error occurred.”

OUTDATED_DISK (11) ERR_DISK (101)

“Failed to dump cube due to disk error.”

OUTDATED_CLOUD (12) ERR_CLOUD (102)

“Failed to upload file stream to cloud storage.”

ERR_DB (103)

“Failed to generate AI metadata.”

ERR_CLICKHOUSE (104)

“Failed to load into Clickhouse.”

ERR_AI (105)

“Failed to generate AI-assisted descriptions.”

Valid values are as follows:

OK = <EnableForAiErrorReason.OK: 0>
UNKNOWN_ERROR = <EnableForAiErrorReason.UNKNOWN_ERROR: -1>
EXCEPTION_WRITING_TO_CLICKHOUSE = <EnableForAiErrorReason.EXCEPTION_WRITING_TO_CLICKHOUSE: 1>
FAILED_WRITING_TO_CLICKHOUSE = <EnableForAiErrorReason.FAILED_WRITING_TO_CLICKHOUSE: 2>
ERROR_WHEN_GETTING_SAMPLE_DATA_FROM_CLICKHOUSE = <EnableForAiErrorReason.ERROR_WHEN_GETTING_SAMPLE_DATA_FROM_CLICKHOUSE: 3>
CUBE_INSTANCE_NOT_FOUND = <EnableForAiErrorReason.CUBE_INSTANCE_NOT_FOUND: 4>
AI_INFORMATION_GENERATION_FAILED = <EnableForAiErrorReason.AI_INFORMATION_GENERATION_FAILED: 5>
DISK_FULL_IN_CLICKHOUSE = <EnableForAiErrorReason.DISK_FULL_IN_CLICKHOUSE: 6>
ERR_GENERAL = <EnableForAiErrorReason.ERR_GENERAL: 100>
ERR_DISK = <EnableForAiErrorReason.ERR_DISK: 101>
ERR_CLOUD = <EnableForAiErrorReason.ERR_CLOUD: 102>
ERR_DB = <EnableForAiErrorReason.ERR_DB: 103>
ERR_CLICKHOUSE = <EnableForAiErrorReason.ERR_CLICKHOUSE: 104>
ERR_AI = <EnableForAiErrorReason.ERR_AI: 105>
OUTDATED_DISK = <EnableForAiErrorReason.OUTDATED_DISK: 11>
OUTDATED_CLOUD = <EnableForAiErrorReason.OUTDATED_CLOUD: 12>
RESERVED = <EnableForAiErrorReason.RESERVED: -100>
class mstrio.project_objects.helpers.EnableForAiState(id, status, error_reason, progress, remaining_time, last_updated_at, user)

Bases: object

Result of a bot cube status query.

Parameters:
id

ID of cube, report or mosaic model.

status

Current enablement status.

error_reason

Error reason if applicable.

progress

progress: Progress percentage (0-100). Available since 25.09 release.

remaining_time

Estimated remaining time for completion in seconds. Available since 25.09 release, but not guaranteed in every server response (for example, it may be missing for terminal statuses). In those cases this value is None.

last_updated_at

Timestamp of last status update.

user

User who initiated the enablement.

error_reason: EnableForAiErrorReason | None
id: str
last_updated_at: int | None
progress: int | None
remaining_time: int | None
status: EnableForAiStatus
user: str | None
enum mstrio.project_objects.helpers.EnableForAiStatus(value)

Bases: AutoName

Enumeration of AI enablement status values.

Valid values are as follows:

NULL = EnableForAiStatus.NULL
READY = EnableForAiStatus.READY
PENDING = EnableForAiStatus.PENDING
FAILED = EnableForAiStatus.FAILED
STARTED = EnableForAiStatus.STARTED
DECERTIFIED = EnableForAiStatus.DECERTIFIED
BASE_CUBE_DECERTIFIED = EnableForAiStatus.BASE_CUBE_DECERTIFIED
RESERVED = EnableForAiStatus.RESERVED

The Enum and its members also have the following methods:

classmethod has_value(value)
mstrio.project_objects.helpers.answer_prompts_helper(instance_id, prompt_answers, get_status_func, get_prompts_func, answer_prompts_func, force)

Helper function to answer prompts for a report or dashboard/document.

Parameters:
  • instance_id (str) – Instance ID of the report or dashboard/document.

  • prompt_answers (list[Prompt] | None) – List of Prompt class objects answering the prompts. Can be None for interactive mode.

  • get_status_func (callable) – Function to get the status of the report or dashboard/document.

  • get_prompts_func (callable) – Function to get the prompts for the report or dashboard/document.

  • answer_prompts_func (callable) – Function to answer the prompts for the report or dashboard/document.

  • force (bool) – If True, then the report/document/dashboard’s existing prompt will be overwritten by ones from the prompt_answers list, and additional input from the user won’t be asked. Otherwise, the user will be asked for input if the prompt is not answered, or if prompt was already answered.

Returns:

True if prompts were answered successfully, False otherwise.

Return type:

bool

mstrio.project_objects.helpers.get_prompt_answer(prompt, prompt_answers, force)
Return type:

Any | list[Any]

Parameters:
  • prompt (dict)

  • prompt_answers (list[dict] | None)

  • force (bool)