vesoft-inc / nebula-python

Client API of Nebula Graph in Python
194 stars 76 forks source link

fix session._connection none error #250

Closed liuxiaocs7 closed 1 year ago

liuxiaocs7 commented 1 year ago

close #249

codecov-commenter commented 1 year ago

Codecov Report

Base: 77.48% // Head: 77.11% // Decreases project coverage by -0.36% :warning:

Coverage data is based on head (9bb2de3) compared to base (f028dfc). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #250 +/- ## ========================================== - Coverage 77.48% 77.11% -0.37% ========================================== Files 18 18 Lines 2407 2408 +1 ========================================== - Hits 1865 1857 -8 - Misses 542 551 +9 ``` | [Impacted Files](https://codecov.io/gh/vesoft-inc/nebula-python/pull/250?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc) | Coverage Δ | | |---|---|---| | [nebula3/gclient/net/SessionPool.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/250/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9nY2xpZW50L25ldC9TZXNzaW9uUG9vbC5weQ==) | `71.61% <0.00%> (-0.31%)` | :arrow_down: | | [nebula3/mclient/\_\_init\_\_.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/250/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9tY2xpZW50L19faW5pdF9fLnB5) | `69.23% <0.00%> (-2.68%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Aiee commented 1 year ago

Hello @liuxiaocs7

Thank you for bringing this to us.

When we release a session here we want to make sure two things: 1. the session is logged out 2. the connection is closed. The fix you proposed here didn't deal with the connection. You could just save the connection to a variable before releasing the session and close the connection later. Something like :

conn = session._connection
session.release()
conn.close()
liuxiaocs7 commented 1 year ago

Hello @liuxiaocs7

Thank you for bringing this to us.

When we release a session here we want to make sure two things: 1. the session is logged out 2. the connection is closed. The fix you proposed here didn't deal with the connection. You could just save the connection to a variable before releasing the session and close the connection later. Something like :

conn = session._connection
session.release()
conn.close()

Thanks for your kindly reply, got it, i'll fix