You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "yoavcloud (via GitHub)" <gi...@apache.org> on 2026/04/09 07:14:46 UTC
[PR] Coding agents guidelines [datafusion-sqlparser-rs]
yoavcloud opened a new pull request, #2298:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2298
I have noticed many recent PRs use coding agents, as well as some of my own.
With coding agents, folks contribute changes faster than before. However, code review may become a bottleneck. And with many PRs containing more changes than actually required, code reviews are getting harder.
I suggest adding an AGENTS.md file to the repo to provide guidelines for coding agents to ensure the project's progress really accelerates in this new age of software development.
This is a first version, and improvements are welcome.
--
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] Coding agents guidelines [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #2298:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2298#discussion_r3079132820
##########
AGENTS.md:
##########
@@ -0,0 +1,35 @@
+# Extensible SQL Lexer and Parser for Rust Agents Guidelines
+
+## General Agent Workflow
+1. You will write unit tests to ensure your code change is working as expected.
+2. You will run the commands in the Pre Commit Checks section below to ensure your change is ready for a pull request.
+3. When instructed to open a PR, you will follow the instructions in the Pull Request Guidelines section below.
+
+## General Coding Guidelines
+1. Refrain from adding conditions on specific dialects, such as `dialect_is!(...)` or `dialect_of!(... | ...)`. Instead, define a new function in the `Dialect` trait that describes the condition, so that dialects can turn this condition on more easily.
+2. Make targeted code changes and refrain from refactoring, unless it's absolutely required.
+
+## Unit Tests Guidelines
+- When testing a multi-line SQL statement, use a raw string literal, i.e. `r#"..."#` to preserve formatting.
+- You can use the following template for simple unit tests:
+```rust
+<dialect>().parse_sql_statements(r#"..."#).unwrap();
+```
+For example: `snowflake().parse_sql_statements(r#"SELECT * FROM my_table"#).unwrap();`
Review Comment:
should we say to use `verified_stmt` instead of `parse_sql_statements`? thinking the former is usually preferrable since it tests the roundtrip behavior as well
--
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] Coding agents guidelines [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #2298:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2298#discussion_r3060520996
##########
AGENTS.md:
##########
@@ -0,0 +1,47 @@
+# Extensible SQL Lexer and Parser for Rust Agents Guidelines
+
+## General Agent Workflow
+1. You will receive a coding task from your operator.
+2. You will analyze the task and come up with a code change to complete it.
+3. You will write unit tests to ensure your code change is working as expected.
+4. You will run the commands in the Pre Commit Checks section below to ensure your change is ready for a pull request.
+5. When instructed to open a PR, you will follow the instructions in the Pull Request Guidelines section below.
Review Comment:
Points 1-2 seem unecessary for coding agents (isn't that what they do in general?)
##########
AGENTS.md:
##########
@@ -0,0 +1,47 @@
+# Extensible SQL Lexer and Parser for Rust Agents Guidelines
+
+## General Agent Workflow
+1. You will receive a coding task from your operator.
+2. You will analyze the task and come up with a code change to complete it.
+3. You will write unit tests to ensure your code change is working as expected.
+4. You will run the commands in the Pre Commit Checks section below to ensure your change is ready for a pull request.
+5. When instructed to open a PR, you will follow the instructions in the Pull Request Guidelines section below.
+
+## Agent Workflow for Fixing Parsing Issues in SQL Statements
+1. You will receive a SQL statement that is not parsed correctly by the project. Typically parsing will fail with an error.
+2. You will add a unit test to check that the SQL statement is indeed unparsed. Follow the instructions in the "Unit Tests" section below.
+3. You will analyze why the SQL statement is not parsed correctly, pointing to the code section that you think is faulty. See more info in the Analyzing Parsing Issues and General Coding Guidelines below.
+4. You will fix the parsing issue and ensure that the new unit test passes successfully by running `cargo test --all-features`.
+5. You will remove the first unit test that you added in step 2 and instead create "synthetic" unit tests to cover the code sections that you modified, to ensure that similar parsing issues are caught in the future.
Review Comment:
Why would we tell it to remove the unit test π€
##########
AGENTS.md:
##########
@@ -0,0 +1,47 @@
+# Extensible SQL Lexer and Parser for Rust Agents Guidelines
+
+## General Agent Workflow
+1. You will receive a coding task from your operator.
+2. You will analyze the task and come up with a code change to complete it.
+3. You will write unit tests to ensure your code change is working as expected.
+4. You will run the commands in the Pre Commit Checks section below to ensure your change is ready for a pull request.
+5. When instructed to open a PR, you will follow the instructions in the Pull Request Guidelines section below.
+
+## Agent Workflow for Fixing Parsing Issues in SQL Statements
+1. You will receive a SQL statement that is not parsed correctly by the project. Typically parsing will fail with an error.
+2. You will add a unit test to check that the SQL statement is indeed unparsed. Follow the instructions in the "Unit Tests" section below.
+3. You will analyze why the SQL statement is not parsed correctly, pointing to the code section that you think is faulty. See more info in the Analyzing Parsing Issues and General Coding Guidelines below.
+4. You will fix the parsing issue and ensure that the new unit test passes successfully by running `cargo test --all-features`.
+5. You will remove the first unit test that you added in step 2 and instead create "synthetic" unit tests to cover the code sections that you modified, to ensure that similar parsing issues are caught in the future.
+6. Run the commands in the Pre Commit Checks section below to ensure that all unit tests are passing and that the code is ready for a pull request.
+7. You will create a PR in the with the changes you made, follow the instructions on Pull Request Guidelines below.
+
+## General Coding Guidelines
Review Comment:
this is good
--
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] Coding agents guidelines [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #2298:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2298
--
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] Coding agents guidelines [datafusion-sqlparser-rs]
Posted by "yoavcloud (via GitHub)" <gi...@apache.org>.
yoavcloud commented on code in PR #2298:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2298#discussion_r3064489603
##########
AGENTS.md:
##########
@@ -0,0 +1,47 @@
+# Extensible SQL Lexer and Parser for Rust Agents Guidelines
+
+## General Agent Workflow
+1. You will receive a coding task from your operator.
+2. You will analyze the task and come up with a code change to complete it.
+3. You will write unit tests to ensure your code change is working as expected.
+4. You will run the commands in the Pre Commit Checks section below to ensure your change is ready for a pull request.
+5. When instructed to open a PR, you will follow the instructions in the Pull Request Guidelines section below.
+
+## Agent Workflow for Fixing Parsing Issues in SQL Statements
+1. You will receive a SQL statement that is not parsed correctly by the project. Typically parsing will fail with an error.
+2. You will add a unit test to check that the SQL statement is indeed unparsed. Follow the instructions in the "Unit Tests" section below.
+3. You will analyze why the SQL statement is not parsed correctly, pointing to the code section that you think is faulty. See more info in the Analyzing Parsing Issues and General Coding Guidelines below.
+4. You will fix the parsing issue and ensure that the new unit test passes successfully by running `cargo test --all-features`.
+5. You will remove the first unit test that you added in step 2 and instead create "synthetic" unit tests to cover the code sections that you modified, to ensure that similar parsing issues are caught in the future.
Review Comment:
The SQL statements I use are typically representative of what we encounter βin the wild.β They tend to be large and complex, with most of the SQL being irrelevant to the specific issue the change addresses. As a result, they are not ideal candidates for unit tests. To improve maintainability, I convert them into canonical forms.
However, this is my own workflow, so I removed it from the repo and will keep it local for now.
--
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