astropy / astropy/pyvo

dal.vosi: compute endpoint URLs by appending strings

Open
#213 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
88
Forks
64
Avg merge
38m
Merged PRs (30d)
1

Description

dal.vosi's TablesMixin obtains the URL to read from like this:

```
try:
interfaces = next(
_ for _ in self.capabilities if _.standardid.startswith(
'ivo://ivoa.net/std/VOSI#tables')
).interfaces
accessurls = chain.from_iterable(_.accessurls for _ in interfaces)
tables_urls = (_.value for _ in accessurls)
except StopIteration:
tables_urls = [
'{}/tables'.format(self.baseurl),
url_sibling(self.baseurl, 'tables')
]
```

-- and it then goes on to try which of these work with the given
authentication.

It shouldn't do this. Some similar thing was attempted in the run-up to
TAP 1.1 (but the plan really has been to match up endpoints based on
titles or something like that). It's been found that this, as planned,
doesn't work, and fixing it would end up in an extremely painful system
(more in Caproles, http://ivoa.net/documents/caproles/).

So, TAP (which at this point is the only protocol that really uses
mechanisms of this type) has fallen back to the TAP 1.0 method of just
adding "tables" to the base URL.

Hence, _tables should just be

```
tables_url = '{}/tables'.format(self.baseurl)
response = self._session.get(tables_url, stream=True)
response.raise_for_status()
return response.raw
```

If nobody protests, I can turn this into a PR (of course, if someone else
relieves me of github clickery, I'd most appreciate it).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at dal.vosi's TablesMixin and its _tables method, then read the existing URL-selection and request flow shown in the issue. Replace the capability-derived and sibling URL attempts with the base URL plus /tables, and confirm that the response is streamed, checked for errors, and returned as raw content.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.