-
Notifications
You must be signed in to change notification settings - Fork 3
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
DAS-1966 - Include documentation notebook for CMR GraphQL. #11
Conversation
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.
Looks good! I just had a few questions about Authorization stuff.
"\n", | ||
"The HTTP request made in this notebook requires two headers:\n", | ||
"\n", | ||
"* `Authorization` - this will include an [Earthdata Login](https://urs.earthdata.nasa.gov/) (EDL) Bearer token.\n", |
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 have couple questions with the authorization stuff (classic):
- Can we use Launchpad tokens for this yet?
- Would someone always have to create a txt file or could they enter the token like we do for all
earthdata-varinfo
functions? - Also do you think it would be worth putting the
Authorization
stuff in the beginning after the import cells?
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.
- Yup. LaunchPad tokens are valid for auth, but they are a bit of a pain to set up. (I should probably include that link you have in your notebook for that)
- Nope they wouldn't have to have the txt file - I left the code cells mostly unchanged (except for PEP8 stuff, of course), but my preferred way would be to retrieve an token from EDL via
requests
, but I thought that would clutter up the notebook and distract the user from the meat of the documentation, because it's probably another 20 lines or so of code. I could implement that instead, or I could add some text to describe a couple of alternative ways to get the token. (Do you have a preference?) This is probably a personal preference, but prefer to have this right by the place where the token is being retrieved. Just because someone getting to this point of the notebook will have both the cell that does something with a token and the documentation about that token on the screen at the same time without scrolling.Sure, will do.
- Add link for LaunchPad token documentation.
- Clarify methods to get a token.
- Move auth higher up the notebook.
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.
Ha - I totally misunderstood 3... I clearly was thinking of the other notebook, because there's not the same level of auth documentation as you provide there. I can move this stuff higher up if you like, sure.
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 discussed in Slack, I added a helper function that retrieves an EDL token programmatically instead of using a text file. (I like this better, but hopefully the notebook is still fairly concise)
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! I think it's a lot better and I will definitely be using that edl helper function!
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.
Thanks for adding more of the authorization information!
Description
This PR adds a documentation notebook showing how to programmatically make queries to the CMR GraphQL API and retrieve UMM-Var records. This notebook is derived from William Valencia's recent Inspect and Adapt demonstration, but has a little bit more descriptive prose added to it.
Jira Issue ID
DAS-1966
Local Test Steps
pip install notebook requests
).generateVariableDrafts
is not available yet in SIT, UAT or production.PR Acceptance Checklist
(No changes toCHANGELOG.md
updated to include high level summary of PR changes.earthdata-varinfo
code)(No changes toVERSION
updated if publishing a release.earthdata-varinfo
code)Tests added/updated and passing.(No changes toearthdata-varinfo
code)