You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2024/11/25 20:20:39 UTC
[PR] fix: Remove unwanted commit on Trino's handle_cursor [superset]
michael-s-molina opened a new pull request, #31154:
URL: https://github.com/apache/superset/pull/31154
### SUMMARY
There was an unwanted commit on Trino's `handle_cursor` for updating the `tracking_url`. That was causing the following error when running queries with multiple statements:
```
Traceback (most recent call last):
File "/srv/superset-internal/apache-superset/superset/sql_lab.py", line 302, in execute_sql_statement
db_engine_spec.execute_with_cursor(cursor, sql, query)
File "/srv/superset-internal/apache-superset/superset/db_engine_specs/trino.py", line 269, in execute_with_cursor
cls.handle_cursor(cursor, query)
File "/srv/superset-internal/apache-superset/superset/db_engine_specs/trino.py", line 195, in handle_cursor
db.session.commit()
File "<string>", line 2, in commit
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/orm/session.py", line 1454, in commit
self._transaction.commit(_to_root=self.future)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/orm/session.py", line 839, in commit
trans.commit()
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2469, in commit
self._do_commit()
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2659, in _do_commit
self._connection_commit_impl()
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2630, in _connection_commit_impl
self.connection._commit_impl()
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1096, in _commit_impl
self._handle_dbapi_exception(e, None, None, None, None)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2134, in _handle_dbapi_exception
util.raise_(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/compat.py", line 211, in raise_
raise exception
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1094, in _commit_impl
self.engine.dialect.do_commit(self.connection)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/default.py", line 686, in do_commit
dbapi_connection.commit()
sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (2013, 'Lost connection to MySQL server during query')
(Background on this error at: https://sqlalche.me/e/14/e3q8)
```
Query execution is wrapped by the `transaction` decorator which should be responsible for calling `session.commit()`. This fix will provoke another less severe problem where the `tracking_url` will not be fresh. We will open a follow-up PR to fix this.
### TESTING INSTRUCTIONS
Using Trino, run a multi-statement SQL.
### ADDITIONAL INFORMATION
- [ ] 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] fix: Remove unwanted commit on Trino's handle_cursor [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #31154:
URL: https://github.com/apache/superset/pull/31154
--
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] fix: Remove unwanted commit on Trino's handle_cursor [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #31154:
URL: https://github.com/apache/superset/pull/31154#issuecomment-2498976426
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/31154?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 65.35%. Comparing base [(`76d897e`)](https://app.codecov.io/gh/apache/superset/commit/76d897eaa2f9e137102bc194c2e3109c29d0348f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`186ed24`)](https://app.codecov.io/gh/apache/superset/commit/186ed248bedd7017e8a4a7f1f47664d04bf21133?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1064 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #31154 +/- ##
==========================================
+ Coverage 60.48% 65.35% +4.87%
==========================================
Files 1931 536 -1395
Lines 76236 38928 -37308
Branches 8568 0 -8568
==========================================
- Hits 46114 25443 -20671
+ Misses 28017 13485 -14532
+ Partials 2105 0 -2105
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/31154/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/31154/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.80% <ø> (-0.36%)` | :arrow_down: |
| [javascript](https://app.codecov.io/gh/apache/superset/pull/31154/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/31154/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.29% <ø> (-0.51%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/31154/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.35% <ø> (+1.87%)` | :arrow_up: |
| [unit](https://app.codecov.io/gh/apache/superset/pull/31154/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.85% <ø> (+3.22%)` | :arrow_up: |
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 Sentry](https://app.codecov.io/gh/apache/superset/pull/31154?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).
--
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