{"record":{"id":"dd9fef263b2fab17","repo":"dbt-labs/dbt-core","slug":"expect-a-bigquerypartitionconfigstruct","errorCode":null,"errorMessage":"Expect a BigqueryPartitionConfigStruct","messagePattern":"Expect a BigqueryPartitionConfigStruct","errorType":"exception","errorClass":"minijinja::Error::InvalidArgument","httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":3872,"sourceCode":"                            };\n                            (key, normalized_value)\n                        })\n                        .collect();\n                    Value::from_serialize(&new_map)\n                } else {\n                    raw_partition_by.clone()\n                };\n\n                let partition_by = minijinja_value_to_typed_struct::<PartitionConfig>(normalized)\n                    .map_err(|e| {\n                    minijinja::Error::new(\n                        minijinja::ErrorKind::SerdeDeserializeError,\n                        format!(\"adapter.parse_partition_by failed on {raw_partition_by:?}: {e}\"),\n                    )\n                })?;\n\n                let validated_config = partition_by.into_bigquery().ok_or_else(|| {\n                    minijinja::Error::new(\n                        minijinja::ErrorKind::InvalidArgument,\n                        \"Expect a BigqueryPartitionConfigStruct\",\n                    )\n                })?;\n\n                Ok(Value::from_object(validated_config))\n            }\n            Postgres | Snowflake | Databricks | Redshift | Salesforce | Spark | DuckDB\n            | LakeCompute | Fabric | ClickHouse | Exasol | Starburst | Athena | Trino\n            | Datafusion | Dremio | Oracle => {\n                unimplemented!(\"only available with BigQuery adapter\")\n            }\n        }\n    }\n\n    /// BigQueryAdapter https://github.com/dbt-labs/dbt-adapters/blob/0efd8d3d1081e1ab43e38797d5104f7b424a6284/dbt-bigquery/src/dbt/adapters/bigquery/impl.py#L1139\n    pub fn get_table_options(\n        &self,","sourceCodeStart":3854,"sourceCodeEnd":3890,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L3854-L3890","documentation":"After successfully deserializing a PartitionConfig, parse_partition_by converts it into a BigQuery-specific partition config via into_bigquery(). If that conversion returns None, an InvalidArgument error 'Expect a BigqueryPartitionConfigStruct' is thrown. This means the parsed config is not representable as a BigQuery partition config, an internal invariant/unexpected config shape.","triggerScenarios":"A PartitionConfig that deserializes but whose variant does not convert to a BigqueryPartitionConfigStruct in into_bigquery(), e.g. a config shape only valid for another adapter.","commonSituations":"Using partition configs designed for another warehouse with the BigQuery adapter; an adapter/version mismatch where a new partition type isn't supported by into_bigquery yet.","solutions":["Simplify or restructure the partition_by config to a documented BigQuery form (time or range partitioning).","Verify you are targeting the BigQuery adapter; other adapters should use their own partition handling.","Upgrade the adapter crate — into_bigquery may not support newer config variants in your version.","If it looks like a valid BigQuery config, file a bug with the raw config; this may be an internal conversion gap."],"exampleFix":"// before (non-BigQuery style)\n{{ config(partition_by={\"columns\": [\"a\", \"b\"]}) }}\n\n// after\n{{ config(partition_by={\"field\": \"created_at\", \"data_type\": \"timestamp\", \"granularity\": \"day\"}) }}","handlingStrategy":"try-catch","validationCode":"def is_bigquery_partition_shape(p):\n    if isinstance(p, str):\n        return True\n    if isinstance(p, dict):\n        has_time = 'field' in p\n        has_range = 'range' in p and {'start', 'end'} <= set(p['range'])\n        return has_time or has_range\n    return False","typeGuard":"def narrow_bigquery_partition(parsed):\n    return parsed if parsed is not None else None  # into_bigquery returned None => not BigQuery-shape","tryCatchPattern":"try:\n    partition_cfg = adapter.parse_partition_by(raw)\nexcept Exception as e:\n    if 'BigqueryPartitionConfigStruct' in str(e):\n        raise ValueError(f'{raw!r} is not a BigQuery-supported partition config') from e\n    raise","preventionTips":["Only use BigQuery-supported partition styles (time via field/granularity, or integer range)","Confirm the executing adapter is BigQuery before applying BigQuery-specific configs","Keep the adapter crate up to date for new partition config variants","Compile a minimal model with the config before wide rollout"],"tags":["bigquery","partitioning","invalid-argument","adapter"],"backgroundTag":"invalid-argument-value","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}