-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SQL Lab] Allow running multiple statements #6112
Conversation
mistercrunch
commented
Oct 15, 2018
- some refactoring to enable this
3fa790a
to
d9bd2d4
Compare
d9bd2d4
to
4d4c7f3
Compare
Please stop sending me emails and unsubscribe me |
@Putop you manage your own Github notifications, nothing we can do on this end. |
e350aac
to
f1e87fc
Compare
0ef65b4
to
0ba6da0
Compare
Codecov Report
@@ Coverage Diff @@
## master #6112 +/- ##
=========================================
+ Coverage 56.04% 56.14% +0.1%
=========================================
Files 516 518 +2
Lines 22996 23044 +48
Branches 2819 2822 +3
=========================================
+ Hits 12887 12939 +52
+ Misses 9648 9644 -4
Partials 461 461
Continue to review full report at Codecov.
|
94f0c6b
to
16de920
Compare
16de920
to
074043f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few comments.
|
||
# revision identifiers, used by Alembic. | ||
revision = 'de021a1ca60d' | ||
down_revision = ('0b1f1ab473c0', 'cefabc8f7d38') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alembic can't merge 3 heads into 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm sure it does, I just rebased 2 times, let me collapse these
) | ||
# Sharing a single connection and cursor across the | ||
# execution of all statements (if many) | ||
with closing(engine.raw_connection()) as conn: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish all DB modules had a context manager for connections and cursors...
cache_timeout = config.get('CACHE_DEFAULT_TIMEOUT', 0) | ||
results_backend.set(key, zlib_compress(json_payload), cache_timeout) | ||
key = str(uuid.uuid4()) | ||
logging.info(f'Storing results in results backend, key: {key}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, f strings!
@@ -2390,11 +2391,11 @@ def results(self, key): | |||
if not results_backend: | |||
return json_error_response("Results backend isn't configured") | |||
|
|||
read_from_results_backend_start = utils.now_as_float() | |||
read_from_results_backend_start = now_as_float() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the context manager here?
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
* Allow running multiple statements from SQL Lab * fix tests * More tests * merge heads * fix heads (cherry picked from commit d427db0) (cherry picked from commit 2980687a2a3382e172bf50c332abe0d2c7048b72)
I started facing problems with the update statement with this pr |