michael-s-molina commented on code in PR #35077:
URL: https://github.com/apache/superset/pull/35077#discussion_r2337457747


##########
superset-frontend/packages/superset-core/src/api/sqlLab.ts:
##########
@@ -111,6 +111,171 @@ export interface Tab {
   panels: Panel[];
 }
 
+/**
+ * Generic data types, see enum of the same name in superset/utils/core.py.
+ */
+enum GenericDataType {
+  Numeric = 0,
+  String = 1,
+  Temporal = 2,
+  Boolean = 3,
+}
+
+/**
+ * Column metadata returned in query results.
+ */
+export type QueryColumn = {
+  /**
+   * Label of the column
+   */
+  name?: string;
+
+  /**
+   * Column name defined
+   */
+  column_name: string;
+
+  /**
+   * Type of the column value
+   */
+  type: string | null;
+
+  /**
+   * Generic data type format
+   */
+  type_generic: GenericDataType;
+
+  /**
+   * True if the column is date format
+   */
+  is_dttm: boolean;
+};
+
+export enum CTASMethod {
+  Table = 'TABLE',
+  View = 'VIEW',
+}
+
+export interface CTAS {
+  /**
+   * Create method for CTAS creation request
+   */
+  method: CTASMethod;
+
+  /**
+   * Temporary table name for creation using a CTAS query
+   */
+  tempTable: string | null;
+}
+
+export interface QueryRequestContext {
+  /**
+   * Unique query ID on client side
+   */
+  id: string;
+
+  /**
+   * Contains CTAS if the query requests table creation
+   */
+  ctas: CTAS | null;
+
+  /**
+   * The SQL editor instance associated with the query
+   */
+  editor: Editor;
+
+  /**
+   * Requested row limit for the query
+   */
+  queryLimit: number | null;
+
+  /**
+   * True if the query execution result will be/was delivered asynchronously
+   */
+  runAsync?: boolean;
+
+  /**
+   * Start datetime for the query in a numerical timestamp
+   */
+  startDttm: number;
+
+  /**
+   * The tab instance associated with the request query
+   */
+  tab: Tab;
+
+  /**
+   * A key-value JSON formatted string associated with Jinja template variables
+   */
+  templateParams: string;
+}
+
+export interface QueryErrorResultContext extends QueryRequestContext {
+  /**
+   * Finished datetime for the query in a numerical timestamp
+   */
+  endDttm: number;
+
+  /**
+   * Error message returned from DB engine
+   */
+  errorMessage: string;
+
+  /**
+   * Error details in a SupersetError structure
+   */
+  errors?: SupersetError[];
+
+  /**
+   * Executed sql after parsing the jinja templates
+   */
+  executedSql: string | null;
+}
+
+export interface QueryResultContext extends QueryRequestContext {
+  /**
+   * Finished datetime for the query in a numerical timestamp
+   */
+  endDttm: number;
+
+  /**
+   * Executed sql after parsing the jinja templates
+   */
+  executedSql: string;
+
+  /**
+   * Actual number of rows returned by the query
+   */
+  limit: number;
+
+  /**
+   * Major factor that is determining the row limit of the query results
+   */
+  limitingFactor: string;
+
+  /**
+   * Remote query id stored in backend
+   */
+  queryId: number;

Review Comment:
   @villebro I don't mean to change the backend side of things. Just the 
frontend part which is not a breaking change as we're still defining the API.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to