Skip to content
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

access_url in RegTAP backward compatibility hacks #341

Merged
merged 2 commits into from
Sep 18, 2022

Conversation

msdemlei
Copy link
Contributor

@msdemlei msdemlei commented Jun 9, 2022

There is a warning now, though, that ought to tip people off when things
go wrong. See also #340; it does
not directly address the problem outlined there.

Relatedly, we now properly parse the arrays-in-strings we get back from
TAP. So far, an empty result yielded [""] in the array of, e.g., access_url.
We ought to have proper string arrays in VOTable one day.

There is a warning now, though, that ought to tip people off when things
go wrong.  See also #340; it does
not directly address the problem outlined there.

Relatedly, we now properly parse the arrays-in-strings we get back from
TAP.  So far, an empty result yielded [""] in the array of, e.g., access_url.
We ought to have proper string arrays in VOTable one day.
@codecov
Copy link

codecov bot commented Jun 9, 2022

Codecov Report

Merging #341 (e8d11b4) into main (197cd38) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #341      +/-   ##
==========================================
+ Coverage   78.28%   78.31%   +0.03%     
==========================================
  Files          46       46              
  Lines        5493     5501       +8     
==========================================
+ Hits         4300     4308       +8     
  Misses       1193     1193              
Impacted Files Coverage Δ
pyvo/registry/regtap.py 78.94% <100.00%> (+0.70%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@msdemlei msdemlei changed the title Getting an access_url when multiple are found no longer errors out. access_url in RegTAP backward compatibility hacks Jun 9, 2022
@msdemlei
Copy link
Contributor Author

msdemlei commented Jun 9, 2022

While composing an answer to Bug #340, I noticed the problem raised there can reasonably be addressed by adding an access_url column that's the unique URL if it exists and None otherwise; that doesn't spoil new behaviour but falls back to what it was when possible. So, the second commit enables that.

" may change in the future."))
return access_urls[0]

def get_unique_access_url(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a new method is needed at this point, the ultimate goal would be to eliminate the previous behaviour and raise the exception if the access_url is not unique.

@@ -196,20 +199,27 @@ def get_summary(self):

This is mainly intended for interactive use, where people would
like to inspect the matches in, perhaps, notebooks.

This returns a column access_url for backwards compatibilty. Do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I don't think this addresses the backward compatibility question, given that get_summary is new in this refactor and as far as I see is not called in any of the other methods to provide backward compatible behaviour.

Maybe the solution is to have a major version bump along with all the changes from the refactor?

This is to try and fix the problem mentioned in the last paragraph of bug #339.
@msdemlei msdemlei force-pushed the pick-random-access-url-again branch from f0f94e6 to e8d11b4 Compare June 13, 2022 07:08
@msdemlei
Copy link
Contributor Author

Ok -- I've force-pushed to this branch, taking out the commit that added acess_url to to_summary's columns.

What's left I'd consider useful, in particular because this will now produce a much less confusing error message when there is no access URL at all (e.g., for authority or standards records; while pyvo itself doesn't do anything with them yet, user programs may have reason to do so, and they could turn up in result sets anyway).

So... I'm grateful for reviews.

@bsipocz bsipocz added this to the v1.4 milestone Aug 17, 2022
Copy link
Contributor

@tomdonaldson tomdonaldson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @msdemlei. I do think these changes are useful, and while not addressing the access_url missing in to_table() aspect of #340 , I feel like this is sufficient.

@msdemlei
Copy link
Contributor Author

msdemlei commented Oct 11, 2022 via email

@bsipocz bsipocz deleted the pick-random-access-url-again branch January 24, 2023 19:32
@bsipocz bsipocz added the Affects-dev To be used for follow-up PRs for new engancements or bugs only present on dev label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects-dev To be used for follow-up PRs for new engancements or bugs only present on dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants