comphead commented on code in PR #14086: URL: https://github.com/apache/datafusion/pull/14086#discussion_r1913638267
########## datafusion/macros/src/user_doc.rs: ########## @@ -192,13 +185,13 @@ pub fn user_doc(args: TokenStream, input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); let name = input.clone().ident; - let doc_section_include: bool = if let Some(doc_section_include) = doc_section_include - { - doc_section_include.value().parse().unwrap() - } else { - true - }; - + let label = doc_section_lbl.as_ref().unwrap().value(); + let doc_section_option = doc_sections_const().iter().find(|ds| ds.label == label); + let (doc_section_include, doc_section_label, doc_section_desc) = + match doc_section_option { + Some(section) => (section.include, section.label, section.description), + None => (true, label.as_str(), None), Review Comment: if the label is not found lets do `eprintln!` saying the predefined doc section cannot be found -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org