action superset_post_chart_data { label: "post_chart_data" description: "Takes a query context constructed in the client and returns payload data response for the given query." provider: superset method: POST path: "/chart/data" encoding: json input: { type: "object" properties: { datasource: { type: "object" required: ["id"] properties: { id: { type: "integer" format: "int32" description: "Datasource id" } type: { type: "string" description: "Datasource type" enum: ["druid", "table"] } } } force: { type: "boolean" description: "Should the queries be forced to load from the source. Default: `false`" } queries: { type: "array" items: { type: "object" properties: { annotation_layers: { type: "array" description: "Annotation layers to apply to chart" items: { type: "object" required: ["name", "show", "showMarkers", "value"] properties: { annotationType: { type: "string" description: "Type of annotation layer" enum: ["FORMULA", "INTERVAL", "EVENT", "TIME_SERIES"] } color: { type: "string" description: "Layer color" } descriptionColumns: { type: "array" description: "Columns to use as the description. If none are provided, all will be shown." items: { type: "string" } } hideLine: { type: "boolean" description: "Should line be hidden. Only applies to line annotations" } intervalEndColumn: { type: "string" description: "Column containing end of interval. Only applies to interval layers" } name: { type: "string" description: "Name of layer" } opacity: { type: "string" description: "Opacity of layer" enum: ["", "opacityLow", "opacityMedium", "opacityHigh"] } overrides: { type: "object" description: "which properties should be overridable" } show: { type: "boolean" description: "Should the layer be shown" } showMarkers: { type: "boolean" description: "Should markers be shown. Only applies to line annotations." } sourceType: { type: "string" description: "Type of source for annotation data" enum: ["", "line", "NATIVE", "table"] } style: { type: "string" description: "Line style. Only applies to time-series annotations" enum: ["dashed", "dotted", "solid", "longDashed"] } timeColumn: { type: "string" description: "Column with event date or interval start date" } titleColumn: { type: "string" description: "Column with title" } value: { description: "For formula annotations, this contains the formula. For other types, this is the primary key of the source object." type: "object" } width: { type: "number" format: "float" description: "Width of annotation line" } } } } applied_time_extras: { type: "object" description: "A mapping of temporal extras that have been applied to the query" } apply_fetch_values_predicate: { type: "boolean" description: "Add fetch values predicate (where clause) to query if defined in datasource" } columns: { type: "array" description: "Columns which to select in the query." items: { type: "string" } } datasource: { type: "object" } druid_time_origin: { type: "string" description: "Starting point for time grain counting on legacy Druid datasources. Used to change e.g. Monday/Sunday first-day-of-week. This field is deprecated and should be passed to `extras` as `druid_time_origin`." } extras: { description: "Extra parameters to add to the query." type: "object" } filters: { type: "array" items: { type: "object" required: ["col", "op"] properties: { col: { type: "string" description: "The column to filter." } op: { type: "string" description: "The comparison operator." enum: ["==", "!=", ">", "<", ">=", "<=", "LIKE", "ILIKE", "IS NULL", "IS NOT NULL", "IN", "NOT IN", "REGEX", "IS TRUE", "IS FALSE"] } val: { description: "The value or values to compare against. Can be a string, integer, decimal or list, depending on the operator." type: "object" } } } } granularity: { type: "string" description: "Name of temporal column used for time filtering. For legacy Druid datasources this defines the time grain." } granularity_sqla: { type: "string" description: "Name of temporal column used for time filtering for SQL datasources. This field is deprecated, use `granularity` instead." } groupby: { type: "array" items: { type: "string" description: "Columns by which to group the query." } } having: { type: "string" description: "HAVING clause to be added to aggregate queries using AND operator. This field is deprecated and should be passed to `extras`." } having_filters: { type: "array" description: "HAVING filters to be added to legacy Druid datasource queries. This field is deprecated and should be passed to `extras` as `having_druid`." items: { type: "object" additionalProperties: true } } is_rowcount: { type: "boolean" description: "Should the rowcount of the actual query be returned" } is_timeseries: { type: "boolean" description: "Is the `query_object` a timeseries." } metrics: { type: "array" description: "Aggregate expressions. Metrics can be passed as both references to datasource metrics (strings), or ad-hoc metricswhich are defined only within the query object. See `ChartDataAdhocMetricSchema` for the structure of ad-hoc metrics." items: { type: "object" } } order_desc: { type: "boolean" description: "Reverse order. Default: `false`" } orderby: { type: "array" description: "Expects a list of lists where the first element is the column name which to sort by, and the second element is a boolean." items: { type: "object" } } post_processing: { type: "array" description: "Post processing operations to be applied to the result set. Operations are applied to the result set in sequential order." items: { type: "object" } } result_type: { type: "object" } row_limit: { type: "integer" format: "int32" description: "Maximum row count (0=disabled). Default: `config[\"ROW_LIMIT\"]`" } row_offset: { type: "integer" format: "int32" description: "Number of rows to skip. Default: `0`" } time_offsets: { type: "array" items: { type: "string" } } time_range: { type: "string" description: "A time rage, either expressed as a colon separated string `since : until` or human readable freeform. Valid formats for `since` and `until` are: \n- ISO 8601\n- X days/years/hours/day/year/weeks\n- X days/years/hours/day/year/weeks ago\n- X days/years/hours/day/year/weeks from now\n\nAdditionally, the following freeform can be used:\n\n- Last day\n- Last week\n- Last month\n- Last quarter\n- Last year\n- No filter\n- Last X seconds/minutes/hours/days/weeks/months/years\n- Next X seconds/minutes/hours/days/weeks/months/years\n" } time_shift: { type: "string" description: "A human-readable date/time string. Please refer to [parsdatetime](https://github.com/bear/parsedatetime) documentation for details on valid values." } timeseries_limit: { type: "integer" format: "int32" description: "Maximum row count for timeseries queries. Default: `0`" } timeseries_limit_metric: { description: "Metric used to limit timeseries queries by." type: "object" } url_params: { type: "object" description: "Optional query parameters passed to a dashboard or Explore view" } where: { type: "string" description: "WHERE clause to be added to queries using AND operator.This field is deprecated and should be passed to `extras`." } } } } result_format: { type: "object" } result_type: { type: "object" } } } output: { type: "object" properties: { result: { type: "array" description: "A list of results for each corresponding query in the request." items: { type: "object" required: ["cache_key", "cache_timeout", "cached_dttm", "is_cached", "query"] properties: { annotation_data: { type: "array" description: "All requested annotation data" items: { type: "object" } } applied_filters: { type: "array" description: "A list with applied filters" items: { type: "object" } } cache_key: { type: "string" description: "Unique cache key for query object" } cache_timeout: { type: "integer" format: "int32" description: "Cache timeout in following order: custom timeout, datasource timeout, default config timeout." } cached_dttm: { type: "string" description: "Cache timestamp" } data: { type: "array" description: "A list with results" items: { type: "object" } } error: { type: "string" description: "Error" } is_cached: { type: "boolean" description: "Is the result cached" } query: { type: "string" description: "The executed query statement" } rejected_filters: { type: "array" description: "A list with rejected filters" items: { type: "object" } } rowcount: { type: "integer" format: "int32" description: "Amount of rows in result set" } stacktrace: { type: "string" } status: { type: "string" description: "Status of the query" enum: ["stopped", "failed", "pending", "running", "scheduled", "success", "timed_out"] } } } } } } }