aiopg icon indicating copy to clipboard operation
aiopg copied to clipboard

add support for "async with cursor_context()"

Open thehesiod opened this issue 9 years ago • 18 comments

resolves https://github.com/aio-libs/aiopg/issues/264

thehesiod avatar Jan 26 '17 00:01 thehesiod

Codecov Report

Merging #265 into master will increase coverage by 0.28%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #265      +/-   ##
==========================================
+ Coverage   93.66%   93.95%   +0.28%     
==========================================
  Files          25       25              
  Lines        3744     3787      +43     
  Branches      199      202       +3     
==========================================
+ Hits         3507     3558      +51     
+ Misses        199      191       -8     
  Partials       38       38
Impacted Files Coverage Δ
aiopg/utils.py 90.05% <100%> (+6.61%) :arrow_up:
aiopg/pool.py 98.91% <100%> (-0.02%) :arrow_down:
tests/test_connection.py 98.23% <100%> (ø) :arrow_up:
aiopg/cursor.py 98.82% <100%> (+0.03%) :arrow_up:
tests/pep492/test_async_await.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8cea23e...1133c6a. Read the comment docs.

codecov-io avatar Jan 26 '17 01:01 codecov-io

Good point, is it possible to hack something so we can support both: async with (await pool.cursor()) and async with pool.cursor() and then deprecate first example in next release?

jettify avatar Jan 29 '17 09:01 jettify

ya I'll work something up in the next few days

thehesiod avatar Jan 29 '17 10:01 thehesiod

@jettify ok, I think I've done it to have the current method backwards and forwards compatible. Getting it to work was tricky. Just tweaking the unittests now for code coverage. Let me know what you think.

thehesiod avatar Feb 17 '17 23:02 thehesiod

@jettify ping :)

thehesiod avatar Jun 21 '17 22:06 thehesiod

I'm using this branch in development and it works very well 👍 .

k4nar avatar Jul 04 '17 13:07 k4nar

@jettify I removed the deprecation warning per @asvetlov since it does technically work, we can deprecate it later I suppose.

thehesiod avatar Jul 04 '17 20:07 thehesiod

ugh, unfortunately don't have enough time to figure out why this fails in travis, gonna revert the docker client upgrade changes :(

thehesiod avatar Jul 04 '17 20:07 thehesiod

hmm, @asvetlov let me know what you think of this error: https://travis-ci.org/aio-libs/aiopg/jobs/250130251#L1360

thehesiod avatar Jul 04 '17 21:07 thehesiod

hmm, this was supposed to have been fixed by https://github.com/aio-libs/aiopg/commit/8ca948ec8e8813065483f799187cfc80f04e268d

thehesiod avatar Jul 04 '17 21:07 thehesiod

ok, looks like you later refactored it in https://github.com/aio-libs/aiopg/commit/2a72b6097e9d0a4c23318b03e57e10767acbbdd4#diff-3416729d6745fac0ca3dd44b22a69068 however it looks like it doesn't work with the latest psycopg2, so I'll let you decide how you want to fix it

thehesiod avatar Jul 04 '17 21:07 thehesiod

@asvetlov ok everything is now passing, let me know if you'd like any other changes

thehesiod avatar Jan 04 '18 17:01 thehesiod

@asvetlov anything left? let's get this merged :)

(after I fix this having broken after merging from master)

thehesiod avatar Mar 17 '18 07:03 thehesiod

@vir-mir @asvetlov can we get this merged?

thehesiod avatar Sep 19 '18 21:09 thehesiod

I can take a look in a few days

asvetlov avatar Sep 20 '18 07:09 asvetlov

FYI failures not my fault

thehesiod avatar Sep 20 '18 07:09 thehesiod

@asvetlov @vir-mir ? :)

thehesiod avatar Oct 16 '18 22:10 thehesiod

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 16 '20 10:11 CLAassistant