-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix: publicationTitle filter only works for projects (#2764) #2792
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2792 +/- ##
===========================================
+ Coverage 83.42% 83.43% +0.01%
===========================================
Files 127 127
Lines 13279 13291 +12
===========================================
+ Hits 11078 11090 +12
Misses 2201 2201
Continue to review full report at Codecov.
|
Title makes no sense, @amarjandu. The publication titles ARE present in the project aggregate. Where they are missing from is the OTHER aggregates. |
52fc6a1
to
c19ecd4
Compare
publication_titles
within project aggregates (#2764)publication_titles
for aggregations (#2764)
c19ecd4
to
2e11d9b
Compare
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.
Just one typo to clean up.
Verified fix by comparing dev (0 hits) against personal deployment (40 hits). https://service.dev.singlecell.gi.ucsc.edu/index/files?filters=%7B%22publicationTitle%22%3A%7B%22is%22%3A%5B%22A%20single-cell%20molecular%20map%20of%20mouse%20gastrulation%20and%20early%20organogenesis%22%5D%7D%7D&size=50&sort=projectTitle&order=asc&catalog=dcp2
test/indexer/data/aaa96233-bf27-44c7-82df-b4dc15ad4d9d.2018-11-02T113344.698028Z.results.json
Outdated
Show resolved
Hide resolved
a871442
to
600938d
Compare
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.
Approved.
Travis reports an error however it is due to codecov failing and does not appear to be due to the PR itself.
Thanks for the heads up, pipeline restarted. |
ced87fb
to
7660e59
Compare
publication_titles
for aggregations (#2764)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.
There should be a test, likely in TestResponse, that shows that we can filter a non-project index by publication title.
5e3a2c3
to
35bda73
Compare
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 think we've been over this a couple times. There's an affinity to overly verbose variable names. More verbose isn't always better. It's worse, in many cases, because it makes the code more noisy, more likely to be in need of wrapping.
Whenever you have test + fix you should do a split commit. I think the C guide stipulates this. Could you check, please?
test/service/test_response.py
Outdated
@@ -1772,6 +1772,61 @@ def test_pagination_search_after_search_before(self): | |||
self.assertEqual(second_page_previous['search_before'], 'null') | |||
self.assertEqual(second_page_previous['search_before_uid'], 'doc#308eea51-d14b-4036-8cd1-cfd81d7532c3') | |||
|
|||
def test_filter_by_publicationTitle(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.
def test_filter_by_publicationTitle(self): | |
def test_filter_by_publication_title(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.
just a heads up there is precedent in this TestClass to have the facet name within the test definition. test_filter_by_projectId
was the one that I saw.
test/service/test_response.py
Outdated
@@ -1772,6 +1772,61 @@ def test_pagination_search_after_search_before(self): | |||
self.assertEqual(second_page_previous['search_before'], 'null') | |||
self.assertEqual(second_page_previous['search_before_uid'], 'doc#308eea51-d14b-4036-8cd1-cfd81d7532c3') | |||
|
|||
def test_filter_by_publicationTitle(self): | |||
expected_filtered_results = [ |
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.
expected_filtered_results = [ | |
cases = [ |
small scope, short variable name
test/service/test_response.py
Outdated
] | ||
for publication_title, bundle_hits in expected_filtered_results: | ||
with self.subTest(publication_title=publication_title): | ||
url = furl(url=self.base_url, path='index/bundles').url |
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.
The ticket doesn't use bundles. It uses files I think. Ideally, the test resembles the repro in the ticket.
test/service/test_response.py
Outdated
() | ||
) | ||
] | ||
for publication_title, bundle_hits in expected_filtered_results: |
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.
for publication_title, bundle_hits in expected_filtered_results: | |
for title, bundles in expected_filtered_results: |
test/service/test_response.py
Outdated
for publication_title, bundle_hits in expected_filtered_results: | ||
with self.subTest(publication_title=publication_title): | ||
url = furl(url=self.base_url, path='index/bundles').url | ||
filters_parameter = { |
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.
filters_parameter = { | |
filters = { |
test/service/test_response.py
Outdated
'is': [publication_title] | ||
} | ||
} | ||
publication_term_facet = { |
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.
publication_term_facet = { | |
expected_terms = { |
3dd3748
to
69b4adf
Compare
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.
Missed from previous review:
Whenever you have test + fix you should do a split commit. I think the C guide stipulates this. Could you check, please?
test/service/test_response.py
Outdated
self.assertEqual(expected_terms, | ||
response.json()['termFacets']['publicationTitle']) | ||
actual_files = { | ||
one(hit['files'])['uuid'] for hit in response.json()['hits'] |
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.
And https://github.com/DataBiosphere/azul/blob/develop/CONTRIBUTING.rst#511review-comments there are some open conversations that need 👍 |
My apologies, I saw this, then missed addressing it. I'll add I was NOT able to locate the section that you mentioned above, I read through all sections that mentioned
In the
I believe this has been done. |
69b4adf
to
78290cd
Compare
test/service/test_response.py
Outdated
actual_files = { | ||
one(hit['files'])['uuid'] | ||
for hit | ||
in response.json()['hits'] |
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.
No wrap before in.
See examples in
https://github.com/DataBiosphere/azul/blob/develop/CONTRIBUTING.rst#14line-wrapping-and-indentation
test/service/test_response.py
Outdated
set() | ||
) | ||
] | ||
for title, files in 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.
for title, files in cases: | |
for title, expected_files in cases: |
test/service/test_response.py
Outdated
self.assertEqual(200, response.status_code) | ||
self.assertEqual(expected_terms, | ||
response.json()['termFacets']['publicationTitle']) | ||
actual_files = { |
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.
actual_files = { | |
files = { |
Should be consistent with prefixing either actual or expected but not mixing both styles.
4938a2a
to
e906d2b
Compare
For demo, attempt to reproduce the issue. |
Add tests to filter by publication_title
e906d2b
to
f696bb0
Compare
5 failed notifications found the failed notification queue, they are already noted in: |
Author
Author (reindex)
r
tag to commit title or this PR does not require reindexingreindex
label to PR or this PR does not require reindexingAuthor (freebies & chains)
chain
label to the blocking PR or this PR is not chained to another PRAuthor (upgrading)
u
tag to commit title or this PR does not require upgradingupgrade
label to PR or this PR does not require upgradingAuthor (requirements, before every review)
make requirements_update
or this PR leaves requirements*.txt, common.mk and Makefile untouchedR
tag to commit title or this PR leaves requirements*.txt untouchedreqs
label to PR or this PR leaves requirements*.txt untouchedAuthor (before every review)
make integration_test
passes in personal deployment or this PR does not touch functionality that could break the ITdevelop
, squashed old fixupsPrimary reviewer (after approval)
no demo
no sandbox
Operator (before pushing merge the commit)
reindex
label andr
commit title tagno demo
sandbox
or addedno sandbox
labelsandbox
or this PR does not require reindexingsandbox
sandbox
or this PR does not require reindexingsandbox
Operator (after pushing the merge commit)
N reviews
labelling is accurateOperator (reindex)
dev
or this PR does not require reindexingdev
dev
or this PR does not require reindexingdev
dev
or this PR does not require reindexingdev
dev
or this PR does not require reindexingdev
prod
or this PR does not require reindexingprod
prod
or this PR does not require reindexingprod
prod
or this PR does not require reindexingprod
prod
or this PR does not require reindexingprod
Operator