rhino_health.lib.endpoints.sql_query.sql_query_dataclass
#
Module Contents#
Classes#
The status of the SQLQuery |
|
Supported sql server Types |
|
Defines the connection details for an external SQL DB |
|
Input parameters for running a metrics on a query in an external SQL DB |
|
Input parameters for importing a dataset form query run on external SQL DB |
|
An SQL query run which exists on the platform |
- class rhino_health.lib.endpoints.sql_query.sql_query_dataclass.QueryResultStatus#
Bases:
str
,enum.Enum
The status of the SQLQuery
- INITIALIZING = 'Initializing'#
- STARTED = 'Started'#
- COMPLETED = 'Completed'#
- FAILED = 'Failed'#
- class rhino_health.lib.endpoints.sql_query.sql_query_dataclass.SQLServerTypes#
Bases:
str
,enum.Enum
Supported sql server Types
- POSTGRESQL = 'postgresql'#
- MARIADB = 'mariadb'#
- MYSQL = 'mysql'#
- ORACLE = 'oracle'#
- SQLITE = 'sqlite'#
- MSSQL = 'mssql'#
- class rhino_health.lib.endpoints.sql_query.sql_query_dataclass.ConnectionDetails(**data: Any)#
Bases:
pydantic.BaseModel
Defines the connection details for an external SQL DB
- server_url: str#
URL of the SQL server to query eg. myserverurl:5432
- server_user: str#
The user to connect to the target SQL server
- server_type: SQLServerTypes#
The type of the SQL server to query
- db_name: str#
The name of the database to query
- password: str#
The user password to connect to the target SQL server
- class rhino_health.lib.endpoints.sql_query.sql_query_dataclass.SQLQueryInput(**data)#
Bases:
SQLQueryBase
Input parameters for running a metrics on a query in an external SQL DB
- metric_definitions: List[rhino_health.lib.metrics.base_metric.BaseMetric]#
The metric definitions to run on the SQL query
- connection_details: ConnectionDetails#
The connection details to the SQL server
- timeout_seconds: int#
The timeout in seconds for the query to run
- project_uid: typing_extensions.Annotated[str, Field(alias='project')]#
The unique ID of the project in whose context this query is done
- workgroup_uid: typing_extensions.Annotated[str, Field(alias='workgroup')]#
The unique ID of the Workgroup in whose context this query is done
- sql_query: str#
Sql query to run
- class rhino_health.lib.endpoints.sql_query.sql_query_dataclass.SQLQueryImportInput(**data)#
Bases:
SQLQueryBase
Input parameters for importing a dataset form query run on external SQL DB
- dataset_name: str#
The name of the dataset to create
- is_data_deidentified: bool#
Whether the data is deidentified or not
- connection_details: ConnectionDetails#
The connection details to the SQL server
- data_schema_uid: typing_extensions.Annotated[Optional[Any], Field(alias='data_schema')]#
The unique ID of the data_schema in whose context this query is done
- timeout_seconds: int#
The timeout in seconds for the query to run
- project_uid: typing_extensions.Annotated[str, Field(alias='project')]#
The unique ID of the project in whose context this query is done
- workgroup_uid: typing_extensions.Annotated[str, Field(alias='workgroup')]#
The unique ID of the Workgroup in whose context this query is done
- sql_query: str#
Sql query to run
- class rhino_health.lib.endpoints.sql_query.sql_query_dataclass.SQLQuery(**data)#
Bases:
rhino_health.lib.endpoints.project.project_baseclass.WithinProjectModel
,rhino_health.lib.endpoints.workgroup.workgroup_baseclass.WithinWorkgroupModel
,SQLQueryBase
,rhino_health.lib.endpoints.user.user_baseclass.UserCreatedModel
An SQL query run which exists on the platform
- property project: Project#
Return the Project Dataclass associated with project_uid
Warning
The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call.
- Returns:
- project: Project
Dataclass representing the Project
- property workgroup: Workgroup#
Return the Workgroup Dataclass associated with workgroup_uid
Warning
The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call.
- Returns:
- workgroup: Workgroup
Dataclass representing the Workgroup
- property creator: User#
Return the User Dataclass associated with creator_uid
Warning
The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call.
- Returns:
- creator: User
Dataclass representing the User
- uid: str#
The Unique ID of the DICOMweb Query
- status: str#
The query status
- ended_at: str | None#
When this query ended
- results: Any | None#
The results of this query
- errors: List[str] | None#
Errors that occurred while running this query
- connection_details: Dict[str, Any]#
The connection details to the SQL server
- sql_query: str#
Sql query to run
- creator_uid: str#
The UID of the creator of this dataclass on the system
- created_at: str#
When this dataclass was created on the system
- project_name: str#
The project name
- workgroup_name: str#
The workgroup name
- creator_name: str#
The creator name
- wait_for_completion(timeout_seconds: int = 500, poll_frequency: int = 10, print_progress: bool = True)#
Wait for the asynchronous SQL query to complete
- Parameters:
- timeout_seconds: int = 500
How many seconds to wait before timing out
- poll_frequency: int = 10
How frequent to check the status, in seconds
- print_progress: bool = True
Whether to print how long has elapsed since the start of the wait
- Returns:
- result: SQLQuery
Dataclasses representing the results of the run
See also