Skip to content

Conversation

@keflavich
Copy link
Contributor

Final update to the UI, I hope - validates query values now too:

Alma.query(payload={'energy.frequency-asu':'5..1'})
Traceback (most recent call last):
  File "<ipython-input-3-9d21fba8506d>", line 1, in <module>
    Alma.query(payload={'energy.frequency-asu':'5..1'})
  File "/Users/adam/repos/astroquery/astroquery/utils/class_or_instance.py", line 24, in <lambda>
    f = lambda *args, **kwds: self.fn(obj, *args, **kwds)
  File "/Users/adam/repos/astroquery/astroquery/utils/process_asyncs.py", line 28, in newmethod
    response = getattr(self, async_method_name)(*args, **kwargs)
  File "/Users/adam/repos/astroquery/astroquery/alma/core.py", line 131, in query_async
    self.validate_query(payload)
  File "/Users/adam/repos/astroquery/astroquery/alma/core.py", line 163, in validate_query
    "{0}".format(bad_kws))
InvalidQueryError: Invalid query parameters: {'energy.frequency-asu': '{"energy.frequency-asu":"org.eso.asu.parser.ASUVisitorException: failed to parse \\"5..1\\" as float"}'}

(the correct way to specify a frequency range is 1 .. 5, with the space

keflavich added a commit that referenced this pull request Sep 23, 2014
Validate *values* of ALMA queries
@keflavich keflavich merged commit a67b820 into astropy:master Sep 23, 2014
@keflavich keflavich deleted the alma/validator branch September 23, 2014 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant