codeant-ai-for-open-source[bot] commented on code in PR #37589:
URL: https://github.com/apache/superset/pull/37589#discussion_r2749404803
##########
superset/db_engine_specs/postgres.py:
##########
@@ -319,6 +319,45 @@ class PostgresEngineSpec(BasicParametersMixin,
PostgresBaseEngineSpec):
"docs_url": "https://www.yugabyte.com/",
"categories": [DatabaseCategory.OPEN_SOURCE],
},
+ {
+ "name": "Supabase",
+ "description": (
+ "Open-source Firebase alternative built on top of
PostgreSQL, "
+ "providing a full backend-as-a-service with a hosted
Postgres "
+ "database."
+ ),
+ "logo": "supabase.svg",
+ "homepage_url": "https://supabase.com/",
+ "pypi_packages": ["psycopg2"],
+ "connection_string": (
+
"postgresql://{username}:{password}@{host}:{port}/{database}"
+ ),
+ "connection_examples": [
+ {
+ "description": "Supabase project (connection pooler)",
+ "connection_string": (
+ "postgresql://{username}.{project_ref}:{password}"
+
"@aws-0-{region}.pooler.supabase.com:6543/{database}"
+ ),
+ },
+ ],
+ "parameters": {
+ "username": "Database user (default: postgres)",
+ "password": "Database password",
+ "host": "Supabase project host (from project settings)",
Review Comment:
**Suggestion:** The Supabase connection example introduces `{project_ref}`
and `{region}` placeholders in the connection string, but these are missing
from the `parameters` mapping, so the generated database docs will show
placeholders that are never described, confusing users and contradicting the
intent of parameter descriptions. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Generated DB docs show undocumented placeholders.
- ⚠️ Users confused when copying connection examples.
- ⚠️ Documentation quality reduced for PostgreSQL compatibility.
```
</details>
```suggestion
"project_ref": "Supabase project reference (from project
settings)",
"region": "Supabase project region (from project
settings)",
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open the modified engine spec at superset/db_engine_specs/postgres.py and
locate the
Supabase entry (file lines ~323-360). The Supabase connection example with
placeholders is
at lines 337-341 (connection_examples.connection_string uses {project_ref}
and {region}):
lines 339-341 contain
"postgresql://{username}.{project_ref}:{password}@aws-0-{region}.pooler.supabase.com:6543/{database}".
2. Run the documented docs generator: from the repo root run the maintainer
step
referenced in the PR ("cd docs && yarn run gen-db-docs") as suggested in PR
testing
instructions. The generator reads metadata.metadata (the metadata dict in
this file) to
produce database docs.
3. In the generated database docs, inspect the PostgreSQL "Compatible
Databases" section.
The generator renders the parameters mapping from
metadata["compatible_databases"][...]["parameters"] (the mapping at lines
344-350).
Because that mapping lacks project_ref and region entries, the generated
docs will show
connection examples containing {project_ref} and {region} placeholders with
no
corresponding parameter descriptions.
4. Observe the user-facing effect: documentation will include example
connection strings
with placeholders that are not described (confusing users and leaving two
placeholders
undocumented). Reproducible by opening the generated markdown/html output
for PostgreSQL
compatible databases after running gen-db-docs and finding the Supabase
entry.
Explanation why this is concrete / not hypothetical: Grep/Read confirmed the
connection_examples string uses {project_ref} and {region} (postgres.py
lines 339-341)
while the parameters mapping for Supabase (lines 344-350) omits both keys,
so the docs
generator (which uses metadata["parameters"]) will have no entries for those
placeholders.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/db_engine_specs/postgres.py
**Line:** 347:347
**Comment:**
*Logic Error: The Supabase connection example introduces
`{project_ref}` and `{region}` placeholders in the connection string, but these
are missing from the `parameters` mapping, so the generated database docs will
show placeholders that are never described, confusing users and contradicting
the intent of parameter descriptions.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]