-
Notifications
You must be signed in to change notification settings - Fork 90
Fix issues #483, #516, and #518 #517
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
Conversation
…. Also rename class Query -> Expression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test seems to have failed due to changes in the test conditions. Please check and ensure test runs again.
datajoint/expression.py
Outdated
| Relational aggregation: | ||
| In aggregation, dj.U is used to compute aggregate expressions on the entire relation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These doc strings need to be updated to use the new terminology (i.e. no relation)
| D().populate() | ||
| E().populate() | ||
| Experiment().populate() | ||
| A.insert(A.contents, skip_duplicates=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mix in instance based inserts as that's supposed to work too. In general, please do not remove test cases but rather just add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have a good mixture. If you review the tests, the majority of tests still instantiate the classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in every operation that's supposed to work for either instance or class ought to be tested on both. And it still holds that in general you shouldn't just be replacing previous test cases if they are supposed to continue to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should add that I realize that this is setup so perhaps it was a bad piece to grab onto to add these notes. May be we should just add a distinct test case that specifically tests the equivalence of class method and instance method calls so that we don't have to worry about using both in all test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not meant for testing, just the regular setup. It works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have testing for both instances and classes.
tests/__init__.py
Outdated
| for db in cur.fetchall(): | ||
| conn.query('DROP DATABASE `{}`'.format(db[0])) | ||
| conn.query('SET FOREIGN_KEY_CHECKS=1') | ||
| conn.query('SET FOREIGN_KEY_CHECKS=1').close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that addition of .close() is a safe operation? The connection object is largely shared throughout the test so we have to ensure that it doesn't get closed in the middle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not close the connection but the cursor. However, I experimented with closing the cursor after every query to attempt to address #515 but I do not think that was the problem. I took all .close() out but forgot this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each query creates its own cursor so closing the cursor should not make any difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair
… what was breaking Travis
…s from __init__ in nosetests
…t with "make_module_code"
This pull request follows PR #514
Fixes #483, #516, #518
.projto preserve the original order of attributesQuery->Expressionandquery.py->expression.py