{"record":{"id":"db25a92a1df996bb","repo":"dbt-labs/dbt-core","slug":"tableset-print-structure-with-output-argument","errorCode":null,"errorMessage":"TableSet.print_structure with output argument","messagePattern":"TableSet\\.print_structure with output argument","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-agate/src/table_set.rs","lineNumber":367,"sourceCode":"            //     Print the keys and row counts of each table in the tableset.\n            //\n            //     :param max_rows:\n            //         The maximum number of rows to display before truncating the data.\n            //         Defaults to 20.\n            //     :param output:\n            //         The output used to print the structure of the :class:`Table`.\n            //     :returns:\n            //         None\n            //     \"\"\"\n            // ```\n            \"print_structure\" => {\n                let args_iter = ArgsIter::new(\"TableSet.print_structure\", &[], args);\n                let max_rows = args_iter.next_kwarg::<Option<usize>>(\"max_rows\")?;\n                let output = args_iter.next_kwarg::<Option<&Value>>(\"output\")?;\n                args_iter.finish()?;\n\n                if output.is_some() {\n                    unimplemented!(\"TableSet.print_structure with output argument\");\n                }\n                self.print_structure(max_rows, None);\n                Ok(Value::from(()))\n            }\n            // TODO: TableSet.scatterplot\n            // TODO: TableSet.select\n            // TODO: TableSet.to_csv\n            // TODO: TableSet.to_json\n            // TODO: TableSet.where\n            // Delegate to the super-class -- MappedSequence\n            _ => MappedSequence::call_method(self, state, method, args, listeners),\n        }\n    }\n\n    fn render(self: &Arc<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        // TODO: delegate to print_structure()\n        MappedSequence::render(self, f)\n    }","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-agate/src/table_set.rs#L349-L385","documentation":"dbt-agate's Rust TableSet.print_structure bridge only supports the max_rows kwarg; if an output argument is supplied it panics via unimplemented!(), because writing structure output to a custom file/stream target is not implemented.","triggerScenarios":"Calling table_set.print_structure(output=<file or stream>) with any non-None value for the output kwarg.","commonSituations":"Porting Python agate code that redirected print_structure output to a file or StringIO; capturing structure output for logs or tests.","solutions":["Call print_structure without the output kwarg (prints to stdout with max_rows only)","Capture stdout externally if output redirection is needed","Implement the output branch in crates/dbt-agate/src/table_set.rs call_method"],"exampleFix":"// before\ntable_set.call_method(\"print_structure\", kwargs!{\"output\" => Value::from(file)})\n// after\ntable_set.call_method(\"print_structure\", kwargs!{\"max_rows\" => Value::from(10usize)})","handlingStrategy":"validation","validationCode":"if output_kwarg.is_some() { panic!(\"print_structure output argument is not supported\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass max_rows to TableSet.print_structure","Redirect stdout at the process level if capture is needed","File an issue / add the output branch in table_set.rs if redirection is required"],"tags":["unimplemented","table-set","print-structure","rust"],"backgroundTag":"operation-not-supported","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"}