{"record":{"id":"faef8ceeb4ec4bb3","repo":"dbt-labs/dbt-core","slug":"get-common-options-is-only-available-with-bigquery","errorCode":null,"errorMessage":"get_common_options is only available with BigQuery adapter","messagePattern":"get_common_options is only available with BigQuery adapter","errorType":"exception","errorClass":"minijinja::Error::InvalidOperation","httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":3957,"sourceCode":"        state: &State,\n        config: ModelConfig,\n        node: &InternalDbtNodeWrapper,\n        temporary: bool,\n    ) -> Result<Value, minijinja::Error> {\n        match self.adapter_type() {\n            Bigquery => {\n                let node = node.as_internal_node();\n                let options = metadata::bigquery::object_options::get_common_table_options_value(\n                    state,\n                    config,\n                    node.common(),\n                    temporary,\n                );\n                Ok(Value::from_serialize(options))\n            }\n            Postgres | Snowflake | Databricks | Redshift | Salesforce | Spark | DuckDB\n            | LakeCompute | Fabric | ClickHouse | Exasol | Starburst | Athena | Trino\n            | Datafusion | Dremio | Oracle => Err(minijinja::Error::new(\n                minijinja::ErrorKind::InvalidOperation,\n                \"get_common_options is only available with BigQuery adapter\",\n            )),\n        }\n    }\n\n    /// Add time ingestion partition column to columns list\n    ///\n    /// BigQueryAdapter https://github.com/dbt-labs/dbt-adapters/blob/0efd8d3d1081e1ab43e38797d5104f7b424a6284/dbt-bigquery/src/dbt/adapters/bigquery/impl.py#L342\n    pub fn add_time_ingestion_partition_column(\n        &self,\n        columns: Value,\n        partition_config: BigqueryPartitionConfig,\n    ) -> AdapterResult<Value> {\n        match self.adapter_type() {\n            Bigquery => {\n                let mut result = Column::vec_from_jinja_value(Bigquery, columns.clone())?;\n","sourceCodeStart":3939,"sourceCodeEnd":3975,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L3939-L3975","documentation":"get_common_options builds adapter-specific common options (e.g. BigQuery job labels/cost caps) but is only implemented for the BigQuery adapter. For Postgres, Snowflake, Databricks, Redshift, Spark, DuckDB, and all other listed adapter types it throws an InvalidOperation error stating the API is BigQuery-only.","triggerScenarios":"Calling get_common_options from a macro or materialization while self.adapter_type() is anything other than BigQuery (Postgres, Snowflake, Databricks, Redshift, Salesforce, Spark, DuckDB, LakeCompute, Fabric, ClickHouse, Exasol, Starburst, Athena, Trino, Datafusion, Dremio, Oracle).","commonSituations":"Reusing a BigQuery-targeted macro across projects with different adapters; copy-pasted custom materializations; running a BigQuery-specific model on another warehouse during migration.","solutions":["Guard the call with an adapter-type check and only call get_common_options under BigQuery.","For other adapters, use their native options APIs or omit the common-options step.","If you need cross-adapter behavior, implement a dispatch: call get_common_options only when adapter_type() == BigQuery, else return a default Value.","Refactor shared materializations so BigQuery-specific option handling is isolated."],"exampleFix":"// before\noptions = adapter.get_common_options(temporary)\n\n// after\nif adapter.type() == 'bigquery':\n    options = adapter.get_common_options(temporary)\nelse:\n    options = {}","handlingStrategy":"type-guard","validationCode":"def supports_common_options(adapter_type):\n    return adapter_type == 'bigquery'","typeGuard":"def is_bigquery(adapter_type):\n    return adapter_type == 'bigquery'","tryCatchPattern":"try:\n    options = adapter.get_common_options(temporary)\nexcept Exception as e:\n    if 'only available with BigQuery' in str(e):\n        options = {}\n    else:\n        raise","preventionTips":["Guard adapter-specific macros with an adapter.type() check","Keep BigQuery option handling in a BigQuery-only override materialization","When porting macros between warehouses, audit adapter-specific API calls","Test materializations under each target adapter in CI"],"tags":["adapter","bigquery","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}