Closed Antar1011 closed 8 years ago
This build will fail, but it's because this PR has revealed a bug, not because it's introduced one, so I'm merging it, even as I work on the solution.
To be clear, I don't love that this test is randomly generated. But I did it with the LogProcessor tests as well, so if I'm going to make an issue of it here, I should fix it there too. Maybe I'll make a "tech debt" ticket?
Weirdly, the error I reported in #62 is not the error that gets thrown on Travis. Wonder if the difference is due to different versions of SQLAlchemy..?
In writing this test, I've discovered a major bug owing to how SQLAlchemy compiles queries. Basically, the current scheme will not work for a full species-lookup. It also won't handle bulk inserts.
See: http://stackoverflow.com/questions/7106016/too-many-sql-variables-error-in-django-witih-sqlite3
The bulk inserts issue can be resolved by doing them the correct way (that is, using the
values
argument inexecute()
rather than the.values()
function inInsert
).The solution to the species-lookup issue appears to be making a temporary table.