Skip to content

style: simplify some strings for readability #15999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hamirmahal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

The goal of this pull request is to improve code readability and maintainability.

What changes are included in this PR?

This change simplifies some strings in the codebase.

Are these changes tested?

Yes, via CI

Are there any user-facing changes?

No

@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate catalog Related to the catalog crate common Related to common crate execution Related to the execution crate proto Related to proto crate functions Changes to functions implementation datasource Changes to the datasource crate ffi Changes to the ffi crate labels May 8, 2025
Copy link
Contributor

@kosiew kosiew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great effort in finding all format! positional arguments!

I left a few other minor improvement suggestions.

@2010YOUY01
Copy link
Contributor

+1 for better readability. I'm wondering is there any clippy configurations to enforce this style?

@2010YOUY01 2010YOUY01 requested a review from Copilot May 9, 2025 08:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies string formatting throughout the codebase to improve readability and maintainability by leveraging new string interpolation syntax. Key changes include updating formatting in error messages, debug logs, and println! calls across multiple modules.

Reviewed Changes

Copilot reviewed 178 out of 178 changed files in this pull request and generated no comments.

Show a summary per file
File Description
datafusion/common/src/dfschema.rs Simplified qualified name formatting using new interpolation syntax.
datafusion/common/src/config.rs Updated error messages to use new interpolation syntax.
datafusion/catalog-listing/src/helpers.rs Adjusted debug logging string interpolation.
datafusion-examples/examples/sql_dialect.rs Updated println! calls to use the new string interpolation syntax.
datafusion-examples/examples/planner_api.rs Switched formatting in plan printing to the new syntax.
datafusion-examples/examples/function_factory.rs Modified error message in UDAF placeholder parsing using new interpolation syntax.
datafusion-examples/examples/expr_api.rs Simplified assertion messages using new interpolation syntax.
datafusion-examples/examples/dataframe.rs Replaced format! calls in SQL queries with new string interpolation.
datafusion-examples/examples/catalog.rs Updated file creation formatting with new interpolation syntax.
datafusion-cli/tests/cli_integration.rs Transitioned AWS options formatting to use new syntax.
datafusion-cli/src/print_options.rs Updated several writeln! calls to use the new string interpolation syntax for consistency.
datafusion-cli/src/pool_type.rs Adjusted error messages with new interpolation syntax.
datafusion-cli/src/main.rs Revised version printing and file path error messages to use new interpolation syntax.
datafusion-cli/src/functions.rs Updated function display formatting with new interpolation syntax.
datafusion-cli/src/exec.rs Simplified error messages and SQL query formatting with new interpolation syntax.
datafusion-cli/src/command.rs Reformatted SQL commands and error messages using new interpolation syntax.
datafusion-cli/src/catalog.rs Changed expected output formatting using new interpolation syntax.
benchmarks/src/util/options.rs Simplified memory limit error message formatting with new interpolation syntax.

@hamirmahal
Copy link
Contributor Author

Great effort in finding all format! positional arguments!

Thanks! clippy actually did this for me. I'll push up commits for the suggestions right now.

+1 for better readability. I'm wondering is there any clippy configurations to enforce this style?

There is. Since there are already a lot of changes in this pull request, I can look into adding the configuration in a future PR.

@hamirmahal hamirmahal force-pushed the style/simplify-some-strings-for-readability branch from b9e2aa7 to cc4bd2d Compare May 10, 2025 18:01
@hamirmahal hamirmahal force-pushed the style/simplify-some-strings-for-readability branch from cc4bd2d to 4275d63 Compare May 10, 2025 18:13
Copy link
Contributor

@2010YOUY01 2010YOUY01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Filed #16021 for the follow-up task

@hamirmahal
Copy link
Contributor Author

You’re welcome!

@github-actions github-actions bot removed sql SQL Planner logical-expr Logical plan and expressions labels May 15, 2025
@github-actions github-actions bot removed physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate catalog Related to the catalog crate common Related to common crate execution Related to the execution crate functions Changes to functions implementation datasource Changes to the datasource crate labels May 15, 2025
@alamb
Copy link
Contributor

alamb commented May 15, 2025

I merged up from main to resolve some conflicts

@hamirmahal
Copy link
Contributor Author

Thanks

@alamb alamb merged commit c74faee into apache:main May 15, 2025
27 checks passed
@hamirmahal hamirmahal deleted the style/simplify-some-strings-for-readability branch May 15, 2025 23:32
brayanjuls pushed a commit to brayanjuls/arrow-datafusion that referenced this pull request May 16, 2025
* style: simplify some strings for readability

* fix: formatting in `datafusion/` directory

* refactor: replace long `format!` string

* refactor: replace `format!` with `assert_eq!`

---------

Co-authored-by: Andrew Lamb <[email protected]>
jfahne pushed a commit to jfahne/datafusion that referenced this pull request May 18, 2025
* style: simplify some strings for readability

* fix: formatting in `datafusion/` directory

* refactor: replace long `format!` string

* refactor: replace `format!` with `assert_eq!`

---------

Co-authored-by: Andrew Lamb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ffi Changes to the ffi crate proto Related to proto crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some strings can be simplified for readability
4 participants