Overview
The Arthur Query service is a feature within Arthur that enables teams to interact with and analyze their data within Arthur Scope. Built with a SQL-like wrapper, the functionality can be used to create metric functions, pull data, create graphs for custom reports, and much more.
Interacting with Arthur Query Service
Python SDK
One of the most common ways teams can query is through the Python SDK.
from arthurai import ArthurAI
## Create Connection to Model of interest
url = ## arthur url
access_key = ## arthur access key
connection = ArthurAI(url = url, access_key = access_key, verify_ssl=False)
model_id = ## model id
arthur_model.connection.get_model(model_id)
## Build Query Function
query_function = {
"select":[ ## .....
]
}
arthur_model.query(query_function)
API
API calls that take in a query expect a JSON-formatted query.
{"select":[
{"property":"*"}
],
"from":"inference"
}
Quick Common Examples
Some of the most common use cases for querying include:
- Pulling Custom Data: Teams often use the query service to pull data that they are interested in experimenting with / reporting on further with custom graphs / reports.
- Creating Metrics to track and alert within Arthur: User-Defined Metrics are created based on the Arthur query language. Teams can also set alerts based on these metrics in the UI, Python SDK, or API after creating a metric.
- Comparing Cohorts: Finally, another common workflow of the query service is to pull cohorts of data to compare in a notebook. This can be done for any function, but some of the most common are performance, drift, or regional explainability.
Updated 12 months ago