icepyx icon indicating copy to clipboard operation
icepyx copied to clipboard

HTML Harmony order details link broken

Open trey-stafford opened this issue 11 months ago • 9 comments

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().

trey-stafford avatar May 23 '25 23:05 trey-stafford

can i take it on

Siddharthh39 avatar May 24 '25 01:05 Siddharthh39

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.

Siddharthh39 avatar May 25 '25 11:05 Siddharthh39

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.

trey-stafford avatar May 27 '25 14:05 trey-stafford

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.

trey-stafford avatar May 27 '25 20:05 trey-stafford

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.

Ok i will take a look.

Siddharthh39 avatar May 28 '25 00:05 Siddharthh39

#691 includes a suggested fix for this issue.

JessicaS11 avatar Sep 12 '25 17:09 JessicaS11

@JessicaS11 I can work on this by the end of the week!

betolink avatar Sep 22 '25 16:09 betolink

@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!

JessicaS11 avatar Oct 10 '25 12:10 JessicaS11

#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...

Image

@trey-stafford what are you expecting this to show?

JessicaS11 avatar Nov 13 '25 17:11 JessicaS11