-
Notifications
You must be signed in to change notification settings - Fork 885
chore(deps): bump third-party JS and Python dependencies #10370
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2abf05e
chore(deps): bump third-party JS and Python dependencies
asheshv 42410cd
fix(deps): pin psycopg to 3.3.4, not 3.3.5
asheshv 9178566
fix(driver): stop relying on psycopg's private _py_codecs shape
asheshv 98bc523
test(driver): unit-test psycopg3 encoding table handling
asheshv 35384d0
fix(deps): revert react-frame-component to 5.2.6
asheshv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| ########################################################################## | ||
| # | ||
| # pgAdmin 4 - PostgreSQL Tools | ||
| # | ||
| # Copyright (C) 2013 - 2026, The pgAdmin Development Team | ||
| # This software is released under the PostgreSQL Licence | ||
| # | ||
| ########################################################################## | ||
|
|
||
| """ | ||
| Unit tests for pgadmin.utils.driver.psycopg3.encoding. | ||
|
|
||
| These guard against psycopg restructuring its private | ||
| psycopg._encodings module (e.g. 3.3.5 changed _py_codecs from a dict | ||
| to a tuple of alias groups, breaking configure_driver_encodings()). | ||
| They don't need a live database connection. | ||
| """ | ||
|
|
||
| import psycopg | ||
|
|
||
| from pgadmin.utils.driver.psycopg3.encoding import get_encoding, \ | ||
| configure_driver_encodings | ||
| from pgadmin.utils.route import BaseTestGenerator | ||
|
|
||
|
|
||
| class TestEncoding(BaseTestGenerator): | ||
| """Validate get_encoding()/configure_driver_encodings() against | ||
| whatever shape the installed psycopg version's encoding tables | ||
| have.""" | ||
|
|
||
| scenarios = [ | ||
| ('UTF8 maps to the utf-8 python codec', | ||
| dict(key='UTF8', expected=['utf-8', 'utf-8'])), | ||
| ('LATIN1 maps to the iso8859-1 python codec', | ||
| dict(key='LATIN1', expected=['ISO88591', 'iso8859-1'])), | ||
| ('SQL_ASCII falls back to the pgAdmin-only override', | ||
| dict(key='SQL_ASCII', expected=['utf-8', 'utf-8'])), | ||
| ('EUC_TW falls back to the pgAdmin-only override', | ||
| dict(key='EUC_TW', expected=['utf-8', 'utf-8'])), | ||
| ('UNICODE falls back to the pgAdmin-only override', | ||
| dict(key='UNICODE', expected=['utf-8', 'utf-8'])), | ||
| ('the ascii special-case resolves via raw_unicode_escape', | ||
| dict(key='ascii', expected=['SQLASCII', 'raw-unicode-escape'])), | ||
| ] | ||
|
|
||
| def setUp(self): | ||
| # No DB connection needed for this test. | ||
| pass | ||
|
|
||
| def runTest(self): | ||
| encodings = {} | ||
| configure_driver_encodings(encodings) | ||
|
|
||
| with self.app.app_context(): | ||
| self.assertEqual(get_encoding(self.key), self.expected) | ||
|
|
||
| # py_codecs/pg_codecs must stay plain dicts and stay in sync, | ||
| # regardless of how psycopg represents its internal encoding | ||
| # table (dict in <=3.3.4, tuple-of-aliases in >=3.3.5). | ||
| self.assertIsInstance(psycopg._encodings.py_codecs, dict) | ||
| self.assertIsInstance(psycopg._encodings.pg_codecs, dict) | ||
| # pg_codecs is the reverse of py_codecs (python codec -> one of | ||
| # its PG names); every value it holds must round-trip back to | ||
| # the same python codec through py_codecs. | ||
| for python_codec, pg_name in psycopg._encodings.pg_codecs.items(): | ||
| self.assertEqual( | ||
| psycopg._encodings.py_codecs.get(pg_name), python_codec) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.