HTML Harmony order details link broken
The "View Details" link that gets rendered when a DataOrder is rendered in a Jupyter Notebook is broken. Clicking on it results in a URL that responds with a 400 status.
The problem is in this line.
self.job_id is a class method of DataOrder, and so the resulting string contains it's repr:
link_html = f'<a target="_blank" href="{self.HARMONY_BASE_URL}{self.job_id}">View Details</a>'
print(link_html)
<a target="_blank" href="https://harmony.earthdata.nasa.gov/workflow-ui/<bound method DataOrder.job_id of DataOrder(job_id=043660ad-15c2-4bd3-81bd-2ad63405b717, type=subset, granules=EarthdataAuth obj with session initialized)>">View Details</a>
I think we should make job_id a property instead of a method (we already track self._job_id as a property - since this isn't computed data, I think we can just drop the class method and replace self._job_id with self.job_id at init time.
Alternatively, replace self.job_id in the link_html string with self._job_id or self.job_id().
can i take it on
Hay, I tried to give a merge request but it tells me to do something with binder and i am pretty new to Contribution, So i don't exactly know how its done, as binder just keeps on loading for me.
Thanks @Siddharthh39! I am not very experienced with Binder myself, but I'll take a look at your associated PR, https://github.com/icesat2py/icepyx/pull/691.
I realized while reviewing #691 that I mischaracterized the root cause of the problem. I updated the description to reflect that realization.
Originally, I thought that we were missing an f to make the href an f-string, but looking at the PR I realized that the whole link_html is already a single f-string. The problem is that self.job_id is a class method, not a property.
I realized while reviewing #691 that I mischaracterized the root cause of the problem. I updated the description to reflect that realization.
Originally, I thought that we were missing an
fto make the href an f-string, but looking at the PR I realized that the wholelink_htmlis already a single f-string. The problem is thatself.job_idis a class method, not a property.
Ok i will take a look.
#691 includes a suggested fix for this issue.
@JessicaS11 I can work on this by the end of the week!
@betolink Are you still able to take this on? Hoping to get the fix and a release through before a couple upcoming icepyx talks later this month!
#715 "fixes" this issue by making it a valid url (no longer a 400 error), but it turns out users don't have access to the page anyway...
@trey-stafford what are you expecting this to show?