add support for ParameterStatus response interceptors#7
Merged
Conversation
Author
Yes, exactly! If we need to intercept another kind of response, we might need to still extend this, but we can follow the same pattern now 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for response interceptors, needed for upgrading flake8 and black via a transitive dependency to packaging>22.
This allows an interceptor in the shape of the following:
To intercept and modify the key and value of the ParameterStatus (see https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-PARAMETERSTATUS).
This is because Postgres would return the following for the server version:
As we can see, the server_version
11.21 (Debian 11.21-1.pgdg110+1)is quite complicated, and theredshift_connectorexpect a version to be strict semantic versioning (usingpackaging>22), and will fail while trying to parse this.We will add an interceptor modifying the
server_versionto be11.21only.\cc @alexrashed