{"record":{"id":"bcc23484e835dcbc","repo":"cube-js/cube","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/adapter/BaseQuery.js","lineNumber":4124,"sourceCode":"   */\n  timestampFormat() {\n    return 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]';\n  }\n\n  /**\n   * @return {number}\n   */\n  timestampPrecision() {\n    return 3;\n  }\n\n  /**\n   * @param {string} field\n   * @return {string}\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  convertTz(field) {\n    throw new Error('Not implemented');\n  }\n\n  /**\n   * URL-encode a SQL expression. Override in dialect-specific query classes\n   * for native URL encoding support. Default implementation uses REPLACE\n   * chains for the most common characters.\n   * @param {string} sql\n   * @return {string}\n   */\n  urlEncode(sql) {\n    return `REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(CAST(${sql} as TEXT), '%', '%25'), '&', '%26'), '=', '%3D'), '+', '%2B'), ' ', '%20')`;\n  }\n\n  /**\n   * @param {string} granularity\n   * @param {string} dimension\n   * @return {string}\n   */","sourceCodeStart":4106,"sourceCodeEnd":4142,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js#L4106-L4142","documentation":"convertTz(field) renders the SQL expression that converts a timestamp into the query's timezone. BaseQuery declares it abstract and throws 'Not implemented'; every concrete adapter must override it. Hitting this error means the code path ran against BaseQuery (or a subclass) that never implemented timezone conversion.","triggerScenarios":"Compiling SQL involving timestamp granularity or timezone-aware dimensions using a query class that inherits BaseQuery.convertTz without overriding it (or a custom adapter forgot the override).","commonSituations":"Writing a custom data source driver based on BaseQuery and missing the convertTz override; queries that include timeDimensions triggering tz conversion on an incomplete custom dialect.","solutions":["Implement convertTz(field) in your adapter's query class to emit dialect-specific tz conversion SQL","If no timezone conversion is desired, override to return the field as-is (document the caveat)","Check you are instantiating the correct concrete query class, not BaseQuery directly"],"exampleFix":"// before (custom adapter)\nclass MyQuery extends BaseQuery {} // convertTz missing\n// after\nclass MyQuery extends BaseQuery {\n  convertTz(field) { return `timezone('${this.timezone}', ${field})`; }\n}","handlingStrategy":"try-catch","validationCode":"const q = adapter.createQuery({});\nif (q.convertTz === BaseQuery.prototype.convertTz) {\n  throw new Error('Adapter must implement convertTz before serving timezone-aware queries');\n}","typeGuard":"function implementsConvertTz(adapter) {\n  return typeof adapter.convertTz === 'function' &&\n    adapter.convertTz !== BaseQuery.prototype.convertTz;\n}","tryCatchPattern":"try { return await cube.load(query); } catch (e) {\n  if (e.message === 'Not implemented' && stackIncludesConvertTz(e)) {\n    throw new Error('Data source adapter lacks timezone conversion support');\n  }\n  throw e;\n}","preventionTips":["Implement convertTz first when writing a custom adapter","Add an adapter smoke test that queries a timeDimension with a timezone"],"tags":["schema-compiler","timezone","abstract-method","custom-adapter"],"backgroundTag":"method-not-implemented","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}