-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
BUG: unable to search SIA with no constraint but maxrec=0 #519
Comments
Never mind, problem is between keyboard and chair, the error is in fact raised by the server, and to work around it I should have searched with responseformat to be votable. |
I'm in fact reopening this, as the Also, while the suggestion for astropy/astroquery#2940 says to do a query with |
The immediate issue of not passing maxrec through has been solved, but we still not parse the returned metadata-only votable properly and this a |
On Thu, Feb 15, 2024 at 11:17:07PM -0800, Brigitta Sipőcz wrote:
The immediate issue of not passing maxrec through has been solved,
but we still not parse the returned metadata-only votable properly
and this a `maxrec=0` query returns an empty table rather than the
metadata description.
The question is what we're supposed to do with this information.
It was originally envisaged that clients could in this way inspect
the schema of the table returned and, if and when we finally get our
STC act together, frames and all that. True: that is in competition
to VOSI tables (although it's even less clear how STC metadata would
be represented there; but then for SIA2 that's an issue only for
custom columns, as all relevant frames for standard columns are fixed
by the standard).
The net result is that there are two competing mechanisms for
something nobody has asked us for (metadata inspection in SIA2), and
hence I'd rather not make a call what kind of API we ought to offer
for table metadata discovery outside of TAP in general (where we
already have it). The one thing I'm sure of is that we'll not ask
our users to pass in MAXREC=0 to a normal search call and then do
something with the resulting VOTable themselves.
But what *should* we do when people pass in MAXREC=0? I mean, this
could have been just a mistake when someone, for instance, wrote
.search(..., MAXREC=recs_yet_to_pull)
But really: I think returning a normal, empty result set is about the
least spurprising behaviour in that case, and so that is what we
should be doing.
|
Yes, I don't mind the empty table as much as not having access to the description (well, I mind it a bit as the standard says it's a special case yet we handle it the very same as any other maxrec). So at minimum, I would still like access to the raw metadata that goes beyond some column metadata (that we kind of parse into the table columns already), even if it only means of printing out the raw votable without parsing it into a table object. |
What do you mean by this, why would |
On Fri, Feb 16, 2024 at 08:46:41AM -0800, Brigitta Sipőcz wrote:
> .search(..., MAXREC=recs_yet_to_pull)
What do you mean by this, why would `recs_yet_to_pull` be a 0 integer?
That was an attempt to come up with a case where people would pass in
MAXREC=0 -- perhaps someone computes maxrec in some way, and that
computation might yield 0 in some corner case. Defensive
programming on our size might then suggest that the behaviour is
continuous (in some sense adapted to the discrete nature of maxrec)
with the maxrec!=0 case.
Or it might not, because arguably that might actually hide bugs in
the application code.
I'll not make a call on my preference until I have better idea where
that zero would come from when. But I'm very sure that we shouldn't
design an API where maxrec=0 is a valid parameter that then takes a
code path different from maxrec!=0; it either should raise an error
or return an empty result.
|
I'm not super concerned for this, as we can always point back to the standard that clearly states that 0 is a special case, and so far we don't have full coverage for problems between keyboard and chair. |
If the functionality is similar to |
While I was trying to resolve astropy/astroquery#2940, I run into this bug
The text was updated successfully, but these errors were encountered: