You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "CuteChuanChuan (via GitHub)" <gi...@apache.org> on 2025/11/02 11:21:13 UTC
[PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
CuteChuanChuan opened a new pull request, #18443:
URL: https://github.com/apache/datafusion/pull/18443
## Which issue does this PR close?
Part of #16915
## Rationale for this change
Format code examples in documentation comments to improve readability and maintain consistent code style across the codebase. This is part of a multi-PR effort to format all doc comment examples and eventually enable CI checks to enforce this formatting.
## What changes are included in this PR?
Run `cargo fmt -p <crate> -- --config format_code_in_doc_comments=true` for the following datasource-related crates:
- `datafusion-spark`
- `datafusion-sql`
- `datafusion-sqllogictest`
- `datafusion-substrait`
- `datafusion-cli`
- `datafusion-examples`
## Are these changes tested?
No testing needed - this is purely a formatting change with no functional modifications.
## Are there any user-facing changes?
No - this only affects documentation formatting.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
Posted by "CuteChuanChuan (via GitHub)" <gi...@apache.org>.
CuteChuanChuan commented on PR #18443:
URL: https://github.com/apache/datafusion/pull/18443#issuecomment-3505579614
@alamb Thanks! ❤️
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
Posted by "CuteChuanChuan (via GitHub)" <gi...@apache.org>.
CuteChuanChuan commented on code in PR #18443:
URL: https://github.com/apache/datafusion/pull/18443#discussion_r2484844383
##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -82,8 +82,11 @@ use std::{sync::Arc, vec};
/// .build()
/// .unwrap();
/// let sql = plan_to_sql(&plan).unwrap(); // convert to AST
Review Comment:
Hi @Weijun-H ,
thanks for the feedback! I've moved the `// convert to AST` comment to a new line.
PTAL when you get a chance. Thanks!
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #18443:
URL: https://github.com/apache/datafusion/pull/18443#issuecomment-3506295900
> @alamb Thanks! ❤️
Thank you for working on this project!
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
Posted by "Weijun-H (via GitHub)" <gi...@apache.org>.
Weijun-H commented on code in PR #18443:
URL: https://github.com/apache/datafusion/pull/18443#discussion_r2484767910
##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -82,8 +82,11 @@ use std::{sync::Arc, vec};
/// .build()
/// .unwrap();
/// let sql = plan_to_sql(&plan).unwrap(); // convert to AST
Review Comment:
It would be better to move `// convert to AST` to a new line.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #18443:
URL: https://github.com/apache/datafusion/pull/18443#discussion_r2488415975
##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -71,7 +71,7 @@ use sqlparser::tokenizer::Span;
/// use datafusion_sql::unparser::expr_to_sql;
/// let expr = col("a").gt(lit(4)); // form an expression `a > 4`
/// let sql = expr_to_sql(&expr).unwrap(); // convert to ast::Expr
-/// // use the Display impl to convert to SQL text
+/// // use the Display impl to convert to SQL text
/// assert_eq!(sql.to_string(), "(a > 4)")
Review Comment:
This looks funky; might need to move that display comment to be at the end of the assert_eq line or otherwise move all comments to their own line (before their related line of code)
##########
datafusion/sql/tests/cases/diagnostic.rs:
##########
@@ -69,7 +69,9 @@ fn do_query(sql: &'static str) -> Diagnostic {
/// ## Example
///
/// ```rust
-/// let spans = get_spans("SELECT /*whole+left*/speed/*left*/ + /*right*/10/*right+whole*/ FROM cars");
+/// let spans = get_spans(
+/// "SELECT /*whole+left*/speed/*left*/ + /*right*/10/*right+whole*/ FROM cars",
+/// );
/// // whole is ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/// // left is ^^^^^
/// // right is ^^
Review Comment:
I think the comments below need to be adjusted as they were referring to the original format
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: Format examples in doc strings - spark, sql, sqllogictest, sibstrait [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #18443:
URL: https://github.com/apache/datafusion/pull/18443
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org