SQL codestyle: trim spacing around 'INHERITS' table list by jayaddison · Pull Request #13397 · sqlalchemy/sqlalchemy · GitHub
Skip to content

SQL codestyle: trim spacing around 'INHERITS' table list#13397

Open
jayaddison wants to merge 1 commit into
sqlalchemy:mainfrom
openculinary:codestyle/pedantic-inherits-spacing
Open

SQL codestyle: trim spacing around 'INHERITS' table list#13397
jayaddison wants to merge 1 commit into
sqlalchemy:mainfrom
openculinary:codestyle/pedantic-inherits-spacing

Conversation

@jayaddison

Copy link
Copy Markdown
Contributor

Description

This is pedantic consistency with other comma-separated SQL lists - e.g. VALUES, IN, DISTINCT ON - and subqueries, where generally parantheses are not inner-padded by space characters.

The test cases updated illustrate the difference:

-            "CREATE TABLE atable (id INTEGER) INHERITS ( i1 )",
+            "CREATE TABLE atable (id INTEGER) INHERITS (i1)",
-            "CREATE TABLE atable (id INTEGER) INHERITS ( i1, i2 )",
+            "CREATE TABLE atable (id INTEGER) INHERITS (i1, i2)",

I noticed during source code diff review between v2.0.50 and v2.0.51 that spaces are added on each side within the parentheses containing the inherited table list.

If it's intentional to draw attention to the fact that these are tables and not column names -- then my apologies, that would seem sorta reasonable.

The parsing/interpretation of these spaces seems unlikely to be the change that microscopically moves the performance needle enough to offset the climate crisis -- indeed the overhead of reading this and responding may be larger -- this is purely me being pedantic.

Checklist

This pull request is:

  • A documentation / typographical / small typing error fix
    • Good to go, no issue or tests are needed

Have a nice day!
(you too; plus weekend)

This is _pedantic_ consistency with other comma-separated SQL
lists - e.g. `VALUES`, `IN`, `DISTINCT ON` - and subqueries,
where generally parantheses are not inner-padded by space
characters.
@jayaddison

Copy link
Copy Markdown
Contributor Author

@CaselIT

CaselIT commented Jun 30, 2026

Copy link
Copy Markdown
Member

I noticed during source code diff review between v2.0.50 and v2.0.51 that spaces are added on each side within the parentheses containing the inherited table list.

I think the spaces were always there, dating back to when it was first implemented in b490534

overall I don't have a preference here, not having the spaces may be better, but I think the ratio noise vs usefulness it quite low here so I'm inclined to leave as is

@CaselIT

CaselIT commented Jun 30, 2026

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants