Migrated ESASky module to use EsaTap/PyVO instead of TAPPlus#3572
Migrated ESASky module to use EsaTap/PyVO instead of TAPPlus#3572imbasimba wants to merge 8 commits intoastropy:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3572 +/- ##
==========================================
+ Coverage 73.10% 73.26% +0.16%
==========================================
Files 224 226 +2
Lines 20839 21032 +193
==========================================
+ Hits 15234 15410 +176
- Misses 5605 5622 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bsipocz
left a comment
There was a problem hiding this comment.
Big picture looks OK, but we will need to think a bit more about what deprecations will need to be done; or if we want to do a clear break and call this a major enough refactor where we don't provide non-breaking API changes.
| urlBase = _config.ConfigItem( | ||
| 'https://sky.esa.int/esasky-tap', | ||
| 'ESASky base URL') | ||
|
|
||
| timeout = _config.ConfigItem( | ||
| 1000, | ||
| 'Time limit for connecting to template_module server.') | ||
|
|
||
| row_limit = _config.ConfigItem( | ||
| 10000, | ||
| 'Maximum number of rows returned (set to -1 for unlimited).') |
There was a problem hiding this comment.
These are public attributes, so I don't think we can remove them without doing a deprecation first.
There was a problem hiding this comment.
(you can make them an alias to the new variables along with a warning)
| def __init__(self, tap_handler=None): | ||
| super().__init__() | ||
| def __init__(self, *, show_messages=False, auth_session=None, tap_url=None): | ||
| super().__init__(auth_session=auth_session, tap_url=tap_url) |
There was a problem hiding this comment.
OK, so this PR will add some backwards incompatible api changes. If we clearly communicate that in the changelog, I think we can be OK with it even if we decide of not doing a deprecation, but we definitely need to communicate that.
cc @keflavich
bsipocz
left a comment
There was a problem hiding this comment.
I see a lot of remote test failures, changing the review status to make sure those will get fixed up before we merge this.
|
Now, I have improved the backward compatibility. I deprecated the old properties and used aliases, restored get_columns, restored and deprecated get_tap, and deprecated parameter tap_handler. Hopefully, that is all the API breaks. Regarding the failing remote tests, they seem unrelated to the ESASky module and appear to be a cache and hooks issue in astroquery.query. See imbasimba@6266128 |
|
@imbasimba - could you separately PR the caching fix? |
Here's a separate PR for the cache fix: #3586 |
bsipocz
left a comment
There was a problem hiding this comment.
Test failures seem to be related and coming from pyvo, I don't think it has anything to do with the caching bug. Could you please have a look at it? Also, a few comments, but I stopped looking into into the details once noticed the test issues.
|
|
||
| @urlBase.setter | ||
| def urlBase(self, value): | ||
| warnings.warn( |
There was a problem hiding this comment.
I'm sorry not picking up on this in the first round, but I wonder if we could/should use the deprecated_attribute functionality from astropy.utils instead?
usage is shown e.g. here: astropy/astropy#19593 (comment)
There was a problem hiding this comment.
although in these cases the alternative is not another property, so you may want to use the message rather than the alternative argument, and may need to instead follow the example in its documentation
| 'DWARF_PLANET', 'SPACECRAFT', 'SPACEJUNK', 'EXOPLANET', 'STAR'] | ||
|
|
||
| def __init__(self, *, show_messages=False, auth_session=None, tap_url=None): | ||
| def __init__(self, *, tap_handler=None, show_messages=False, auth_session=None, tap_url=None): |
There was a problem hiding this comment.
please use the @deprecated_renamed_argument decorator from astropy.utils instead; plenty of examples for it in the other modules here
Fix some issues with the ESASky tests
|
You are correct, there were some unrelated errors from our backend. We updated our backend recently (in between me writing the code for the "caching fix" and actually posting it as a PR), which broke some of the tests. I have now deployed a fix to our backend. I have also pushed another commit addressing some of the doc tests (mostly just removing validation of the output that changes a lot depending on updates we do in our database almost monthly). When I run the ESASky remote tests now on this branch I get five errors. All of them show an error that looks something like this: If I apply the fix from the other PR all the ESASky remote tests pass. I have not yet addressed the other comments you had about how to best deprecate things. |
Following the merge of #3511, here is the migration for the ESASky module