-
Notifications
You must be signed in to change notification settings - Fork 0
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
iteration on has_target from keyword #84
Conversation
Quality Gate passedIssues Measures |
return " or ".join(f'{property_name} eq "{s}"' for s in _canonicalize_string(value)) | ||
|
||
q_string = eq_cannonical_string_clause("pds:Identification_Area.pds:title", keyword) | ||
q_string += f"or {eq_cannonical_string_clause('pds:Alias.pds:alternate_title', keyword)}" |
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.
Is a leading space before or
needed here?
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 that works without but that will be cleaner with.
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.
Visual inspection: ✓
Tests: ✓
py39: OK (15.34=setup[2.02]+cmd[13.33] seconds)
congratulations :) (15.48 seconds)
Approval: ✓ 🎉
identifiers = [identifiers] | ||
|
||
if len(identifiers) > 0: | ||
clause = "or ".join([f'ref_lid_target eq "{identifier}"' for identifier in identifiers]) |
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.
A leading space before the or
here might be needed here as well?
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 that works without but that will be cleaner with.
@@ -12,7 +12,7 @@ | |||
# in the `PDS keyword search <https://pds.nasa.gov/datasearch/keyword-search/search.jsp>`_ | |||
mercury_id = "urn:nasa:pds:context:target:planet.mercury" | |||
# filter here: | |||
products = pep.Products(client).has_target(mercury_id).before(date1).observationals() | |||
products = pep.Products(client).has_target("Mercury").before(date1).observationals() |
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.
Since mercury_id
is still defined, maybe we should include an example of both variations of the new has_target
convention here.
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.
Correct, I will fix that.
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.
Actually I removed it for now since the plan is to have only the keyword search in the quickstart. As we need to enrich the quickstart we can had back new cases as they come in the quickstart in the online doc.
import unittest | ||
from datetime import datetime | ||
from typing import get_args | ||
|
||
import pds.peppi as pep # type: ignore | ||
from pds.api_client import PdsProduct | ||
|
||
logger = logging.getLogger(__name__) |
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.
Why was this added? I don't see any logging going on in this test suite now.
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 can remove that, I think I added when I was unable to assert something in the logs, I need to check that this works without that.
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.
New approach looks fine to me
🗒️ Summary
⚙️ Test Data and/or Report
Test available in unittest.
♻️ Related Issues
improves #74