-
Notifications
You must be signed in to change notification settings - Fork 117
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
Reduce db queries #454
Reduce db queries #454
Conversation
… ``Node.local_groups`` relationship instead of DB queries where possible.
…ere as separate records).
Looks good! |
Except for the still failing test on PostgreSQL "caused" by that change: disko@1efb134#diff-090c6d6f97cd0028f14840e7b7f6aa94R227 :( |
to possible fuzzy translations; see wichert/lingua#59 Additionally now we print file being currently compiled so that we know which statistic is for which language. Added '--no-wrap' option to invocation of `msgmerge` to avoid wrapping original msgids. Wrapping needlessly "mangles" original msgids. Please note that both options were lost during migration to lingua 3.6.1 in commit Kotti@285bad5
@disko I'd like to help get this one passing, can you ping me instructions on how you're running the test suite against postgres pls? mkvirtualenv reduce-db-queries
python setup.py dev
pip install psycopg2
createdb -T template0 -E UTF8 -O mattr kotti
KOTTI_TEST_DB_STRING="postgresql+psycopg2://mattr@/kotti" py.test fwiw, I get one failure with the above: |
@mgrbyte this is exactly what I'm running and also the exact same failure. The failure occurs with This makes absolutely no sense to me. I've removed that single assert in 66b285f and the test suite passes again on all environments. Tbh: I'm tempted to leave it removed and merge the branch… |
@disko I think I solved it (maybe) I think the test might be selecting the wrong control? Line 548, insert:
The current test uses the control with |
On 26 Sep 2015, at 22:15, Matt Russell wrote:
I tried that, too. Unfortunately the test fails on MySQL and SQLite |
@disko I think its something do with the order of test execution not being the same.
Under PostgreSQL:
It would seem that either:
|
@disko The order of the rows is different, so I conclude that the ordering @@contents view changes depending on db backend. To test this theory out, I dug around the code a bit.
That makes the test pass on both backends (and @@contents is order the same for both back-ends) See the docstring for sqlalchemy.ext.orderinglist. |
fwiw, the whole test suite passes under both sqlite and pg with the reorder_on_append added. |
@mgrbyte you da man! thanks so much! |
Current coverage is
|
This supersedes #448 snd #449 (same implementation, cleaned up commits)