From: Mike Bayer Date: Mon, 19 Dec 2022 13:34:51 +0000 (-0500) Subject: add exclusion for unusual chars in column names X-Git-Tag: rel_1_4_46~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deef63c190a423ed7a6d340df17a6318492c1fb2;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add exclusion for unusual chars in column names Added new exclusion rule for third party dialects called ``unusual_column_name_characters``, which can be "closed" for third party dialects that don't support column names with unusual characters such as dots, slashes, or percent signs in them, even if the name is properly quoted. Fixes: #9002 Change-Id: I44b765df4c73ce5ec1907d031fd9c89761fd99d1 References: #8993 (cherry picked from commit 946058ec6070ab4db9fdfab612ec4543fea9cd1c) --- diff --git a/doc/build/changelog/unreleased_14/9002.rst b/doc/build/changelog/unreleased_14/9002.rst new file mode 100644 index 0000000000..c2d3f01b9f --- /dev/null +++ b/doc/build/changelog/unreleased_14/9002.rst @@ -0,0 +1,10 @@ +.. change:: + :tags: bug, tests + :tickets: 9002 + + Added new exclusion rule for third party dialects called + ``unusual_column_name_characters``, which can be "closed" for third party + dialects that don't support column names with unusual characters such as + dots, slashes, or percent signs in them, even if the name is properly + quoted. + diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 8cd4c64f27..e225512889 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -152,6 +152,17 @@ class SuiteRequirements(Requirements): return exclusions.open() + @property + def unusual_column_name_characters(self): + """target database allows column names that have unusual characters + in them, such as dots, spaces, slashes, or percent signs. + + The column names are as always in such a case quoted, however the + DB still needs to support those characters in the name somehow. + + """ + return exclusions.open() + @property def subqueries(self): """Target database must support subqueries.""" diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py b/lib/sqlalchemy/testing/suite/test_dialect.py index 99947bbe4f..c1c0856c32 100644 --- a/lib/sqlalchemy/testing/suite/test_dialect.py +++ b/lib/sqlalchemy/testing/suite/test_dialect.py @@ -343,6 +343,7 @@ class DifficultParametersTest(fixtures.TestBase): ) @tough_parameters + @config.requirements.unusual_column_name_characters def test_round_trip_same_named_column( self, paramname, connection, metadata ):