Skip to content

Close transport when fetching the schema failed #297

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

Conversation

joricht
Copy link
Contributor

@joricht joricht commented Feb 18, 2022

Fetching the schema from the transport might fail with an exception. This Commit
ensures that the transport is closed in such a case and the client object can be
used to open a new session.

Fetching the schema from the transport might fail with an exception. This Commit
ensures that the transport is closed in such a case and the client object can be
used to open a new session.
Copy link
Collaborator

@leszekhanusz leszekhanusz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Could you please also add two tests for sync and async ?

@leszekhanusz leszekhanusz linked an issue Feb 18, 2022 that may be closed by this pull request
@joricht
Copy link
Contributor Author

joricht commented Feb 18, 2022

@leszekhanusz Thank you for the quick reply and review. I am on holiday over the weekend and will address everything on Monday.

@joricht
Copy link
Contributor Author

joricht commented Feb 21, 2022

@leszekhanusz I added two tests and a comment why I catch the broad exception. Can you have a look at it again. Thank you!

@leszekhanusz
Copy link
Collaborator

Thanks. Please read the CONTRIBUTING.md file to see how to fix linter errors (running make check)

@joricht
Copy link
Contributor Author

joricht commented Feb 22, 2022

@leszekhanusz Thanks for being so patient. Now all tests should pass and the coding guidelines are also respected.

@codecov-commenter
Copy link

Codecov Report

Merging #297 (18fead4) into master (12fc895) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #297   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         2060      2068    +8     
=========================================
+ Hits          2060      2068    +8     
Impacted Files Coverage Δ
gql/client.py 100.00% <100.00%> (ø)

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 12fc895...18fead4. Read the comment docs.

@leszekhanusz
Copy link
Collaborator

LGTM 🚀

@leszekhanusz leszekhanusz merged commit 0084b95 into graphql-python:master Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-using client after schema fetching failed
3 participants