{"record":{"id":"885c19c1cb031b63","repo":"dbt-labs/dbt-core","slug":"should-match-sql-ignoring-whitespace-differences","errorCode":null,"errorMessage":"Should match SQL ignoring whitespace differences","messagePattern":"Should match SQL ignoring whitespace differences","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/time_machine/event_replay.rs","lineNumber":3317,"sourceCode":"                timestamp_ns: seq as u64 * 1000,\n            }\n        }\n\n        // Create events with SQL that differs only by whitespace\n        let events = vec![make_sql_event(\n            \"node1\",\n            0,\n            \"execute\",\n            \"SELECT   *\\nFROM    users\\nWHERE   id = 1\",\n            SemanticCategory::Write,\n        )];\n        let recording = make_recording(events);\n\n        // Should match with compact SQL (whitespace removed)\n        let compact_sql = serde_json::json!([\"SELECT * FROM users WHERE id = 1\"]);\n        let event = recording\n            .take_semantic_match(\"node1\", \"execute\", &compact_sql, SemanticCategory::Write)\n            .expect(\"Should match SQL ignoring whitespace differences\");\n        assert_eq!(event.method, \"execute\");\n    }\n\n    // -------------------------------------------------------------------------\n    // SAO (State Aware Orchestration) tests\n    // -------------------------------------------------------------------------\n\n    use super::super::event::{RecordedRunCacheCloneDecision, RunCacheCloneEvent, SaoStatus};\n\n    /// Helper to create a test Recording with SAO events\n    fn make_recording_with_sao(\n        adapter_events: Vec<AdapterCallEvent>,\n        sao_events: Vec<SaoEvent>,\n    ) -> Recording {\n        let mut adapter_events_by_node: BTreeMap<String, Vec<AdapterCallEvent>> = BTreeMap::new();\n        for event in adapter_events {\n            adapter_events_by_node\n                .entry(event.node_id.clone())","sourceCodeStart":3299,"sourceCodeEnd":3335,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/time_machine/event_replay.rs#L3299-L3335","documentation":"Test-only assertion in the whitespace-normalization test: SQL differing only in whitespace must still match a recorded event when compared via the compacted form. Fires only if whitespace-insensitive semantic matching regresses.","triggerScenarios":"Thrown at crates/dbt-adapter/src/time_machine/event_replay.rs:3317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the SQL compaction/normalization applied before semantic comparison","Re-run the semantic matching tests with whitespace-variant fixtures","Treat failure as a matching-engine regression"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}