Copilot commented on code in PR #43501:
URL: https://github.com/apache/superset/pull/43501#discussion_r3855073958


##########
superset/db_engine_specs/cockroachdb.py:
##########
@@ -44,7 +44,7 @@ class CockroachDbEngineSpec(PostgresEngineSpec):
             DatabaseCategory.TRADITIONAL_RDBMS,
             DatabaseCategory.OPEN_SOURCE,
         ],
-        "pypi_packages": ["cockroachdb"],
+        "pypi_packages": ["sqlalchemy-cockroachdb"],

Review Comment:
   `metadata["pypi_packages"]` should list the DBAPI driver needed to actually 
connect (consistent with other Postgres-derived specs like PostgresEngineSpec 
using `psycopg2`). Listing only `sqlalchemy-cockroachdb` can mislead users into 
installing the dialect without the driver.



##########
pyproject.toml:
##########
@@ -142,7 +142,13 @@ bigquery = [
     "google-cloud-bigquery>=3.42.3",
 ]
 clickhouse = ["clickhouse-connect>=1.7.1, <2.0"]
-cockroachdb = ["cockroachdb>=0.3.5, <0.4"]
+# The `cockroachdb` PyPI package (last released 2021) is abandoned and its
+# SQLAlchemy dialect cannot even import under SQLAlchemy 2.0 (it references
+# sqlalchemy.dialects.postgresql.psycopg2.PGCompiler_psycopg2, removed in
+# 2.0). sqlalchemy-cockroachdb is the actively maintained replacement,
+# already linked from CockroachDbEngineSpec.metadata's docs_url, and
+# registers the same `cockroachdb` SQLAlchemy dialect entry point.
+cockroachdb = ["sqlalchemy-cockroachdb>=2.0.0, <3"]

Review Comment:
   The `cockroachdb` extra installs the SQLAlchemy dialect but not the 
PostgreSQL DBAPI driver. `sqlalchemy-cockroachdb` does not depend on 
`psycopg2-binary`, so `pip install apache-superset[cockroachdb]` can still fail 
at runtime when attempting to connect due to a missing driver. Consider 
including the existing `postgres` extra (or `psycopg2-binary`) so the 
CockroachDB extra is self-contained.



-- 
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]

Reply via email to