You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "hy144328 (via GitHub)" <gi...@apache.org> on 2026/08/17 22:21:26 UTC
[PR] chore: Unset future flag in engines and sessions. [superset]
hy144328 opened a new pull request, #43273:
URL: https://github.com/apache/superset/pull/43273
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
See #40273 .
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
SQLAlchemy is bumped to version 2.0, and it is time to remove the scaffolding.
This PR removes the future flags, that enabled version 2 behavior in SQLAlchemy 1.4.
This PR reverses #42277 and #42365 .
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
I `grep`ed for occurrences of `future` and `True`.
There should be no effect.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Unset future flag in engines and sessions. [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #43273:
URL: https://github.com/apache/superset/pull/43273#discussion_r3799410309
##########
superset/db_engine_specs/gsheets.py:
##########
@@ -389,7 +389,6 @@ def validate_parameters(
}
}
},
- future=True,
)
conn = engine.connect()
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Connection resource leak</b></div>
<div id="fix">
The connection at line 393 is never explicitly closed and has no `finally` block or context manager. Multiple early returns (lines 414, 425) bypass any potential cleanup. Compare to the correct pattern at line 525: `with engine.connect() as conn:`. This causes a resource leak where the database connection remains open after the function returns.
</div>
</div>
<small><i>Code Review Run #d015f4</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset/migrations/versions/2024-02-07_17-13_87d38ad83218_migrate_can_view_and_drill_permission.py:
##########
@@ -73,7 +73,7 @@ def upgrade():
def downgrade():
bind = op.get_bind()
- session = Session(bind=bind, future=True)
+ session = Session(bind=bind)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent exception handling</b></div>
<div id="fix">
The `downgrade()` function catches SQLAlchemyError but silently ignores it by printing and calling `pass`, allowing the migration to report success even on failure. The `upgrade()` function correctly re-raises exceptions. Inconsistent error handling between upgrade/downgrade creates a maintenance hazard and can mask database migration failures.
</div>
</div>
<small><i>Code Review Run #d015f4</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Unset future flag in engines and sessions. [superset]
Posted by "sha174n (via GitHub)" <gi...@apache.org>.
sha174n commented on PR #43273:
URL: https://github.com/apache/superset/pull/43273#issuecomment-5368855702
Heads up that this may not be a no-op: the project currently pins sqlalchemy<2 (1.4.x), and on 1.4 future=True opts into 2.0-style connection/transaction/commit semantics. Removing it on the live paths (e.g. streaming_export/base.py, db_engine_specs/gsheets.py, migrations/shared/catalogs.py) reverts them to legacy 1.x behavior, which the test suite won't necessarily surface. Could you clarify the intended behavior here (and whether this is prep for the SQLAlchemy 2.0 work) rather than a chore, and scope it to the paths you actually mean to change?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Unset future flag in engines and sessions. [superset]
Posted by "hy144328 (via GitHub)" <gi...@apache.org>.
hy144328 commented on PR #43273:
URL: https://github.com/apache/superset/pull/43273#issuecomment-5371518027
Thanks for the feedback, @sha174n . Not sure that I follow. After #42803 , my understanding is that we are now on SQLAlchemy 2, see https://github.com/apache/superset/blob/a05a0999877f6f3aa73c447f722e1e9630b98910/pyproject.toml#L114 and https://github.com/apache/superset/blob/a05a0999877f6f3aa73c447f722e1e9630b98910/requirements/development.txt#L953 . Where are we still pinned to SQLAlchemy 1.4?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Unset future flag in engines and sessions. [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #43273:
URL: https://github.com/apache/superset/pull/43273
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Unset future flag in engines and sessions. [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43273:
URL: https://github.com/apache/superset/pull/43273#issuecomment-5320941377
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Unset future flag in engines and sessions. [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43273:
URL: https://github.com/apache/superset/pull/43273#issuecomment-5320958784
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43273?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 65.95%. Comparing base ([`97eafd6`](https://app.codecov.io/gh/apache/superset/commit/97eafd6140085f81ec3e70c85215cd5e6a5608fb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`9fa26f4`](https://app.codecov.io/gh/apache/superset/commit/9fa26f4874c1f0b18022055a59e580ea204f1085?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #43273 +/- ##
==========================================
- Coverage 66.41% 65.95% -0.47%
==========================================
Files 2874 2879 +5
Lines 163787 164405 +618
Branches 37799 37797 -2
==========================================
- Hits 108787 108430 -357
- Misses 52864 53840 +976
+ Partials 2136 2135 -1
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/43273/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [superset-extensions-cli](https://app.codecov.io/gh/apache/superset/pull/43273/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.57% <ø> (?)` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/43273/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/43273?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org