-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ENH: select column/coordinates/multiple with start/stop/selection #6177
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
can you show (in the top of this PR), e.g. an ipython session of some use cases (you can use stripped down versions of your test cases). and before/after if it matters (e.g. for the API change/bug on the errors). |
as an aside...been meaning to fix/completely rewrite the API for select_as_multiple. If you store a small amount of meta data, it is easy to reconstruct these linked tables. Furthermore the way of specifying the key / join tables could be a lot better (e.g. a function/object oriented interface) luv to here ideas. |
had not so much time this week. fixed the bug with pytables < 3.0 (which showed up on in the python 2.7 travis build), but Travis build seems not to work anymore for 2.7. I'll post examples later. Mainly its about using start/stop in all select_... and in remove and to apply the selection filter for read_coordinates. |
just force it to build again
|
Here's an example showing how select_as_multiple did handle start before the commit in contrast to select:
The result is empty, as the where is first applied and the start is applied on the filtered result. select_as_coordinates misbehaves when where cause results in a filter expression:
Here, the filter expression is ignored, so everything is returned After the fix, we have:
|
@@ -2195,6 +2195,68 @@ def test_remove_where(self): | |||
# self.assertRaises(ValueError, store.remove, | |||
# 'wp2', [('column', ['A', 'D'])]) | |||
|
|||
def test_remove_startstop(self): | |||
|
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.
can you put a reference to the issues number here (or the PR if their isn't an issue associated)
need a release note mentioning this changes (make 2 notes, one in API section about the TypeError changing to KeyError , 1 in Bug fix section), reference the issue (or the this PR) if their isnt' an associated issue. squash em all down to 1-2 commits....then ok to merge |
how should i referent the pr? with |
issue |
This commit fixes issues with start/stop and selection. Furthermore select_as_mutlipe is implemented differently: - select_column and remove now hanlde start/stop arguments - select_as_multipe hanldes start/stop the same way as select - select_as_coordinates and select_column works with where expressions that result in filters. This also fixes select_as_multipe with filters - select_as_multipe table iterator is rewritting, so memory usage is constant. select_as_multiple now will always throw a KeyError if either a key or the selector is not found. Also closes GH4835
ENH: select column/coordinates/multiple with start/stop/selection
@wabu thanks...this is really great! I suppose if the user specifies start and/or stop of the complete table range then all rows will be deleted by the table will still exists, which I think is ok. If you find that a problem, can come back and address it later (e.g. you change change start=0 to start=None, and stop=nrows to stop=None). But a minor point. |
select_as_multiple/column/coordinate and remove behaves strange on combinations of where clauses and start/stop keyword arguments so I started fixing this.
I changed select_as_multiple to select coordinates inside the TableIterator, so it will work on large tables. Moreover select_as_multiple always throws a KeyError when either a key or the selector is not available in the file.
Closes #4835.