Skip to content

Conversation

@dimitri-yatsenko
Copy link
Member

@dimitri-yatsenko dimitri-yatsenko commented Nov 13, 2018

This pull request follows PR #514
Fixes #483, #516, #518

  • Update .proj to preserve the original order of attributes
  • Renames Query -> Expression and query.py -> expression.py

@coveralls
Copy link

coveralls commented Nov 13, 2018

Coverage Status

Coverage increased (+1.8%) to 90.386% when pulling bae0900 on dimitri-yatsenko:master into 9fdecfe on datajoint:master.

@eywalker eywalker changed the title Fix issues #483 and #516 Fix issues #483, #516, and #518 Nov 14, 2018
Copy link
Contributor

@eywalker eywalker left a 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.

Relational aggregation:
In aggregation, dj.U is used to compute aggregate expressions on the entire relation.
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

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()
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants