Add case insensitivity feature to GenericFunction.#4570
Add case insensitivity feature to GenericFunction.#4570adrien-berchet wants to merge 12 commits intosqlalchemy:masterfrom
Conversation
82924c4 to
0a8b385
Compare
|
looks very nice, let's run on CI |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision 0a8b385 of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 0a8b385: https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
|
Tests were failing because they are run in parallel in the CI. I forced the |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision 9c84dc8 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 9c84dc8 added to existing Gerrit review https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision 60f2da2 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 60f2da2 added to existing Gerrit review https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
|
I wrote a tool to do the imports called zimports, all you do is install it, cd into the sqlalchemy checkout and type "zimports". or give it the filenames you care about. I dont think anyone uses it but it works pretty great over here. |
|
Nice tool, thx :) |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision f64e7af of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset f64e7af added to existing Gerrit review https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision 537fa19 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 537fa19 added to existing Gerrit review https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
|
keep in mind im just waiting for CI to be done i haven't looked at this yet |
It's ok, these talks are very instructive for me so it is much more enjoyable than tiring :-) |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision 0156bfd of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 0156bfd added to existing Gerrit review https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
|
I am not able to reproduce the failures reported by the CI with Python 2.7. Is it possible to get the docker image used to run the tests please? Or do you have any idea of what is causing this? |
|
mike bayer (zzzeek) wrote:
yeah that is a very strange occurrence, and also the sqlalchemy2 gerrit seems to be running which it's not supposed to here so ill try to resolve all this today. |
|
mike bayer (zzzeek) wrote:
yeah it's kind of a worst case scenario problem where the faliure only happens with the complete tox run, not individual py.test runs and even not if I enable xdist, im going to have it print out what it's seeing but yeah this would be very tough for people new to the test suite to figure out... |
|
mike bayer (zzzeek) wrote: OH. it's that sqlalchemy2 job getting in and spreading mischief. sqlalchemy2 is taking out that "lib/" folder. I thought and thought, ok HOW can this break things. How can it? it can't break anything, people install a package, lib/ is gone. Nothing will break, right? This breaks! when your CI checks both out in the same directory and the .pycs hang around. |
|
mike bayer (zzzeek) wrote: recheck |
Oh, that's a tricky CI bug... |
sqla-tester
left a comment
There was a problem hiding this comment.
Adrien Berchet (adrien-berchet) wrote:
(2 comments)
Some tests are still failing after your last commit. It seems it is due to a wrong order when keys are transformed into list. Maybe we should just sort the case-sensitive keys?
- test/sql/test_deprecations.py (line 288): Remove one empty line
| "different letter cases and might interact with '{}'. " | ||
| "GenericFunction objects will be fully case-insensitive in a " | ||
| "future release.".format( | ||
| list(case_sensitive_reg[identifier].keys()), |
There was a problem hiding this comment.
Adrien Berchet (adrien-berchet) wrote:
Maybe we should replace list by sorted so that the key order would be always the same, whatever the Python version is used. The deprecation test would then be easier to write.
|
I see that you pushed a new commit on gerrit and some tests are still failing. How can I get these changes from gerrit to my branch to propose a fix? |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work to try to get revision 37d4f33 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 37d4f33 added to existing Gerrit review https://gerrit.sqlalchemy.org/#/c/sqlalchemy/sqlalchemy/+/1178 |
|
mike bayer (zzzeek) wrote: sorry this has fallen behind. I will be getting to this soon. |
No problem, I will see when you have some time to get back to this :) |
|
Oh, I realize that my last commit discarded the change log you introduced in patch set 9, sorry about that... |
|
mike bayer (zzzeek) wrote: Code-Review+2 Workflow+1 |
|
Gerrit review https://gerrit.sqlalchemy.org/1178 has been merged. Congratulations! :) |
|
mike bayer (zzzeek) wrote: Code-Review+2 Workflow+1 |
|
Gerrit review https://gerrit.sqlalchemy.org/1241 has been merged. Congratulations! :) |
The :class:`.GenericFunction` namespace is being migrated so that function names are looked up in a case-insensitive manner, as SQL functions do not collide on case sensitive differences nor is this something which would occur with user-defined functions or stored procedures. Lookups for functions declared with :class:`.GenericFunction` now use a case insensitive scheme, however a deprecation case is supported which allows two or more :class:`.GenericFunction` objects with the same name of different cases to exist, which will cause case sensitive lookups to occur for that particular name, while emitting a warning at function registration time. Thanks to Adrien Berchet for a lot of work on this complicated feature. Fixes: #4569 Closes: #4570 Pull-request: #4570 Pull-request-sha: 37d4f33 Change-Id: Ief07c6eb55bf398f6aad85b60ef13ee6d1173109 (cherry picked from commit ede0f2282fc44a6831abfcc562e1ae04661b5739)
|
great job,thanks for the above and beyond effort on this! |
|
Thanks, I'm glad this helps :) |
Description
Fixes: #4569
Following this discussion: geoalchemy/geoalchemy2#216
The goal of the PR is to allow the possibility to register case-insensitive
GenericFunction(s).By default, the case-sensitivity is kept in order to keep the current behavior.
Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>in the commit messageHave a nice day!