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

Remove defaults for SIAv1 query params #367

Merged
merged 4 commits into from
Jan 26, 2023

Conversation

tomdonaldson
Copy link
Contributor

Fixes #366

Remove the SIAv2 client-side defaults for the format, intersect and verbosity parameters. This enables the client to not submit optional parameters for non-compliant services that have trouble with those parameters.

@tomdonaldson tomdonaldson self-assigned this Sep 29, 2022
@tomdonaldson tomdonaldson added this to the v1.4.1 milestone Sep 29, 2022
pyvo/dal/sia.py Outdated
@@ -46,7 +46,7 @@


def search(
url, pos, size=1.0, format='all', intersect="overlaps", verbosity=2,
url, pos, size=1.0, format=None, intersect=None, verbosity=None,
Copy link
Member

Choose a reason for hiding this comment

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

you'll need to update the default for format in the docstring below, too. The rest looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, good point! There are 2 other places in the code where the docstring mentions the default, but the function signature default is None. I could edit them all to indicate that the default is a server-side default, but then for consistency I suppose I should add that same info for intersect and verbosity. It may help a user to know the server-side default, so maybe it's worth the extra words, but I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

format and intersect are fine as those are the service defaults as well so behaviour is unchanged.

I couldn't find a default for verbosity in the spec so I'm not sure if this changes the behaviour. But the spec says that "Services that do not support this parameter must permit it to be present without error." so it shouldn't create any problems if present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right about verbosity. I was remembering that it defaults to 2 for Simple Cone Search. To minimize the potential changes in behavior to standard-compliant services for this change, I should restore the client-side default for verbosity.

Ideally (if all services were fully compliant) none of this should matter, but there's a non-compliant service I want to use that breaks if you specify format. I don't want to have special code in pyvo for non-compliant services, but having pyvo specify defaults that should be implemented on the server really is unnecessary at best and possibly confusing. I think the user should have control over what params get submitted in the query.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The client can work around the above problem with format=None. That's somewhat workable, but would need to be done as a special case for the offending service.

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #367 (00c4c39) into main (085a04f) will decrease coverage by 0.14%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
- Coverage   79.97%   79.83%   -0.14%     
==========================================
  Files          52       52              
  Lines        5972     5972              
==========================================
- Hits         4776     4768       -8     
- Misses       1196     1204       +8     
Impacted Files Coverage Δ
pyvo/dal/sia.py 62.19% <ø> (-3.26%) ⬇️
pyvo/dal/ssa.py 55.75% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@msdemlei msdemlei left a comment

Choose a reason for hiding this comment

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

I'd say this is a good idea in principle. I don't think I'm too enthused that we don't use the opportunity to drop the default on VERB, which I think as been a mistake to begin with, in particular because I don't think common validators bother to test that services actually ignore it.

On the other hand, I'd expect that if there are SIA services out there that do anything at all with VERB (which I doubt), passing 2 to them shouldn't hurt, and those that stutter when you pass VERB need to be fixed anyway. Hence: You've got my vote.

@andamian andamian added the bug label Oct 4, 2022
@andamian
Copy link
Contributor

andamian commented Oct 4, 2022

@tomdonaldson I think this would need a change log. I'm wondering why the bot hasn't picked it up.

@bsipocz
Copy link
Member

bsipocz commented Oct 4, 2022

the changelog bot is rather flaky, and not always triggered. The issue is known, but we don't yet have a solution for it (or do we @pllim?)

@bsipocz
Copy link
Member

bsipocz commented Oct 4, 2022

(and due to that flakyness I very much still like using the changelog checking scripts at release time, but then those rely on everything is merged with a merge commit rather than squashed at the top of main).

@pllim
Copy link
Member

pllim commented Oct 4, 2022

If you are talking about astropy-bot , I do not have a solution. It works when it wants to. It is deployed on Heroku and Heroku clamped down on OSS support due to "abuse" (wish I kept link to their blog about that but I don't have it anymore).

@pllim
Copy link
Member

pllim commented Oct 4, 2022

I have https://github.com/pllim/action-check_astropy_changelog . Even though it is archived, it still seems to work for Jdaviz.

https://github.com/spacetelescope/jdaviz/blob/main/.github/workflows/changelog_check.yml

And I just stumbled upon a really basic check that does not require any custom action here if this is good enough for you:

https://github.com/spacetelescope/jwst/blob/master/.github/workflows/changelog.yml

Copy link
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.

What about, for good measures, doing the same for SSA, too, where format='all' is set?

@msdemlei
Copy link
Contributor

msdemlei commented Jan 25, 2023 via email

@bsipocz
Copy link
Member

bsipocz commented Jan 26, 2023

Removed the default for SSA, and rebased for changelog conflict. Given the approval, if CI is happy, I'll go ahead and merge.

@bsipocz bsipocz merged commit e84045a into astropy:main Jan 26, 2023
@bsipocz
Copy link
Member

bsipocz commented Jan 26, 2023

Thank you @tomdonaldson!

@bsipocz bsipocz mentioned this pull request Feb 15, 2023
bsipocz added a commit that referenced this pull request Mar 7, 2023
Remove defaults for SIAv1 query params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't set client-side defaults for SIA query params
5 participants