Skip to content

Migrated ESASky module to use EsaTap/PyVO instead of TAPPlus#3572

Open
imbasimba wants to merge 8 commits intoastropy:mainfrom
imbasimba:esasky-pyvo
Open

Migrated ESASky module to use EsaTap/PyVO instead of TAPPlus#3572
imbasimba wants to merge 8 commits intoastropy:mainfrom
imbasimba:esasky-pyvo

Conversation

@imbasimba
Copy link
Copy Markdown
Contributor

Following the merge of #3511, here is the migration for the ESASky module

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 64.55696% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.26%. Comparing base (dbf41fd) to head (fca11cc).
⚠️ Report is 117 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/esasky/core.py 53.65% 19 Missing ⚠️
astroquery/esasky/__init__.py 76.31% 9 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bsipocz bsipocz added the esasky label Apr 3, 2026
@bsipocz bsipocz added this to the 0.4.12 milestone Apr 3, 2026
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines -9 to -19
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).')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are public attributes, so I don't think we can remove them without doing a deprecation first.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(you can make them an alias to the new variables along with a warning)

Comment thread astroquery/esasky/core.py
Comment on lines -82 to +85
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)
Copy link
Copy Markdown
Member

@bsipocz bsipocz Apr 3, 2026

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

I see a lot of remote test failures, changing the review status to make sure those will get fixed up before we merge this.

@imbasimba
Copy link
Copy Markdown
Contributor Author

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.
Let me know if I got the property deprecation/aliases right. I’ve never used them myself.

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
Let me know your thoughts on this workaround, and if acceptable, I can merge it into this PR.

@imbasimba
Copy link
Copy Markdown
Contributor Author

@bsipocz

@bsipocz
Copy link
Copy Markdown
Member

bsipocz commented Apr 30, 2026

@imbasimba - could you separately PR the caching fix?

@emellega
Copy link
Copy Markdown
Contributor

emellega commented May 4, 2026

@imbasimba - could you separately PR the caching fix?

Here's a separate PR for the cache fix: #3586

Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

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(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Comment thread astroquery/esasky/core.py
'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):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please use the @deprecated_renamed_argument decorator from astropy.utils instead; plenty of examples for it in the other modules here

@emellega
Copy link
Copy Markdown
Contributor

emellega commented May 5, 2026

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:

pyvo.io.vosi.exceptions.W19: ?:?:?: W19: TAP Capabilities must not have an ivo-id other than ivo://ivoa.net/std/TAP

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants