# Cube.js Tasks
This is a collection of tasks to interact with a Cube.js or Cube Cloud environment.
# CubeJSQueryTask
class
prefect.tasks.cubejs.cubejs_tasks.CubeJSQueryTask
(subdomain=None, url=None, api_secret=None, api_secret_env_var="CUBEJS_API_SECRET", query=None, include_generated_sql=False, security_context=None, wait_time_between_api_calls=10, max_wait_time=None, **kwargs)[source]This task calls Cueb.js load API and returns the result as a JSON object. More info about Cube.js load API at https://cube.dev/docs/rest-api#api-reference-v-1-load.
Args:
subdomain (str, optional)
: The subdomain to use to get the data. If provided,subdomain
takes precedence overurl
. This is likely to be useful to Cube Cloud users.url (str, optional)
: The URL to use to get the data. This is likely to be useful to users of self-hosted Cube.js.api_secret (str, optional)
: The API secret used to generate an API token for authentication. If provided, it takes precedence overapi_secret_env_var
.api_secret_env_var (str, optional)
: The name of the env var that contains the API secret to use to generate an API token for authentication. Defaults toCUBEJS_API_SECRET
.query (dict, list, optional)
:dict
orlist
representing valid Cube.js queries. If you pass multiple queries, then be aware of Cube.js Data Blending. More info at https://cube.dev/docs/rest-api#api-reference-v-1-load and at https://cube.dev/docs/schema/advanced/data-blending. Query format can be found at: https://cube.dev/docs/query-format.include_generated_sql
: (bool, optional): Whether the return object should include SQL info or not. Default toFalse
.security_context (str, dict, optional)
: The security context to use during authentication. If the security context does not contain an expiration period, then a 7-day expiration period is added automatically. More info at: https://cube.dev/docs/security/context.wait_time_between_api_calls (int, optional)
: The number of seconds to wait between API calls. Default to 10.max_wait_time (int, optional)
: The number of seconds to wait for the Cube.js load API to return a response.**kwargs (optional)
: Additional keyword arguments to pass to the standard Task initalization.
methods: |
---|
prefect.tasks.cubejs.cubejs_tasks.CubeJSQueryTask.run (subdomain=None, url=None, api_secret=None, api_secret_env_var="CUBEJS_API_SECRET", query=None, include_generated_sql=False, security_context=None, wait_time_between_api_calls=10, max_wait_time=None)[source] |
Task run method to perform a query using Cube.js load API.
Returns:
|
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC