Copilot commented on code in PR #40276:
URL: https://github.com/apache/superset/pull/40276#discussion_r3270953836
##########
superset/migrations/versions/2020-01-08_01-17_e96dbf2cfef0_datasource_cluster_fk.py:
##########
@@ -49,7 +49,7 @@ def upgrade():
clusters = sa.Table("clusters", metadata, autoload=True)
statement = datasources.update().values(
- cluster_id=sa.select([clusters.c.id])
+ cluster_id=sa.select(clusters.c.id)
.where(datasources.c.cluster_name == clusters.c.cluster_name)
.as_scalar()
)
Review Comment:
`Select.as_scalar()` is deprecated in SQLAlchemy 1.4/2.0 and will emit
`RemovedIn20Warning`. Since this PR is already updating SQLAlchemy 2.0-style
APIs, consider replacing `.as_scalar()` with `.scalar_subquery()` (or an
equivalent scalar subquery) to avoid future breakage when upgrading to
SQLAlchemy 2.0.
##########
superset/migrations/versions/2020-01-08_01-17_e96dbf2cfef0_datasource_cluster_fk.py:
##########
@@ -91,7 +91,7 @@ def downgrade():
clusters = sa.Table("clusters", metadata, autoload=True)
statement = datasources.update().values(
- cluster_name=sa.select([clusters.c.cluster_name])
+ cluster_name=sa.select(clusters.c.cluster_name)
.where(datasources.c.cluster_id == clusters.c.id)
.as_scalar()
)
Review Comment:
`Select.as_scalar()` is deprecated in SQLAlchemy 1.4/2.0 and will emit
`RemovedIn20Warning`. Consider switching this to `.scalar_subquery()` while
touching this migration so it stays compatible with the SQLAlchemy 2.0 API.
##########
pytest.ini:
##########
@@ -18,5 +18,30 @@
testpaths =
tests
python_files = *_test.py test_*.py *_tests.py *viz/utils.py
-addopts = -p no:warnings
+# `-p no:warnings` temporarily disabled in favor of more finely tuned
`filterwarnings`.
+#addopts = -p no:warnings
asyncio_mode = auto
+
+# `ignore` virtually reproduces to `-p no:warnings`.
Review Comment:
Grammar nit: "virtually reproduces to" is unidiomatic English and reads as a
typo. Consider rephrasing to something like "is effectively equivalent to" to
keep the comment clear.
--
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]