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

BUG: registry narrative documentation fails with DALQueryError #568

Open
bsipocz opened this issue Jun 28, 2024 · 5 comments
Open

BUG: registry narrative documentation fails with DALQueryError #568

bsipocz opened this issue Jun 28, 2024 · 5 comments

Comments

@bsipocz
Copy link
Member

bsipocz commented Jun 28, 2024

  • running all the tests, or tests for the registry module (e.g. pytest -P registry -R), they all pass
  • running pytest only on this narrative docs file, I run into. I suspect (but haven't looked into it properly yet) that some mocking may go wrong and been reused for the narrative docs:
docs/registry/index.rst F                                                                                                                                                                                        [100%]

======================================================================================================= FAILURES =======================================================================================================
_________________________________________________________________________________________________ [doctest] index.rst __________________________________________________________________________________________________
151       ivo://cds.vizier/j/aj/151/146 ...
152       ivo://cds.vizier/j/apj/727/14 ...
153   ...
154 
155 And to look for tap resources *in* a specific cone, you would do
156 
157 .. doctest-remote-data::
158 
159   >>> from astropy.coordinates import SkyCoord
160   >>> registry.search(registry.Freetext("Wolf-Rayet"),
UNEXPECTED EXCEPTION: DALQueryError: Field query: Could not parse your query: Expected ")", found ','  (at char 1046), (line:15, col:36)
Traceback (most recent call last):
  File "/Users/bsipocz/.pyenv/versions/3.12.1/lib/python3.12/doctest.py", line 1359, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest index.rst[9]>", line 1, in <module>
  File "/Users/bsipocz/munka/devel/pyvo/pyvo/registry/regtap.py", line 250, in search
    return query.execute()
           ^^^^^^^^^^^^^^^
  File "/Users/bsipocz/munka/devel/pyvo/pyvo/registry/regtap.py", line 268, in execute
    return RegistryResults(self.execute_votable(), url=self.queryurl)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bsipocz/munka/devel/pyvo/pyvo/dal/query.py", line 336, in __init__
    raise DALQueryError(self._status[1], self._status[0], url)
pyvo.dal.exceptions.DALQueryError: Field query: Could not parse your query: Expected ")", found ','  (at char 1046), (line:15, col:36)
/Users/bsipocz/munka/devel/pyvo/docs/registry/index.rst:160: UnexpectedException
=============================================================================================== short test summary info ================================================================================================
FAILED docs/registry/index.rst::index.rst
================================================================================================== 1 failed in 34.02s ==================================================================================================

Does anyone else see the same problem?

@ManonMarchand
Copy link
Member

Might have been introduced with #562 , I forgot to check the narrative docs before merging

@bsipocz
Copy link
Member Author

bsipocz commented Jun 28, 2024

No, that wasn't it, the problem exists on main, prior merging that PR. And the CI for that PR runs for the narrative docs, but it also runs all the other tests before the docs thus the problem was masked.

@msdemlei
Copy link
Contributor

msdemlei commented Jul 1, 2024 via email

@ManonMarchand
Copy link
Member

Or use tcpdump locally so that you can read what is sent? I usually go with (close any annoying app that communicates too much via http):

prepare request

tcpdump -i any -w /tmp/http.pcap

send my request

killall tcpdump

read the file (with tcpdump -r) to find what exactly did I ask in the request

@msdemlei
Copy link
Contributor

msdemlei commented Jul 1, 2024 via email

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

No branches or pull requests

3 participants