Skip to content

The casjobs query results involving bigint column produce errors.  #10

Description

@segasai

Hi,

When trying to query the skyserver/casjobs I can do it without issues if I don't ask for the specobjid column in a query , but if I add it, I'm getting a bunch of errors.

The simple code (based on the example) is given below

importSciServerfromSciServerimportAuthentication, LoginPortal, Config, CasJobs, SkyQuery, SciDrive, SkyServer, Files, JobsimportosimportpandasimportsysimportjsonfromioimportStringIOfromioimportBytesIO#from PIL import Image importnumpyasnpimportmatplotlib.pyplotaspltAuthentication_loginName='**'#CHANGE ME Authentication_loginPassword='**'token1=LoginPortal.login(Authentication_loginName,
Authentication_loginPassword)
casJobsId=CasJobs.getSchemaName()
print(casJobsId)
Query=' select top 10 ra,dec from specphotoall'# this works Query=' select top 10 ra,dec,plate from specphotoall'# this works Query=' select top 10 ra,dec,specobjid from specphotoall'#this doesn't df=CasJobs.executeQuery(sql=Query, context='DR16', format="fits")
fd=open('xx.fits', 'wb')
fd.write(df.read())
fd.close()

The error is

Traceback (most recent call last):
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 685, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 425, in _error_catcher
yield
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 752, in read_chunked
self._update_chunk_length()
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 689, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/koposov/pyenv36/lib/python3.6/site-packages/requests/models.py", line 751, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 560, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 781, in read_chunked
self._original_response.close()
File "/home/koposov/python36/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/home/koposov/pyenv36/lib/python3.6/site-packages/urllib3/response.py", line 443, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "doit.py", line 23, in <module>
df = CasJobs.executeQuery(sql=Query, context='DR16', format="fits")
File "/home/koposov/pyenv36/lib/python3.6/site-packages/SciServer-2.0.13-py3.6.egg/SciServer/CasJobs.py", line 171, in executeQuery
File "/home/koposov/pyenv36/lib/python3.6/site-packages/requests/models.py", line 829, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/home/koposov/pyenv36/lib/python3.6/site-packages/requests/models.py", line 754, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

Background info. I'm using sciserver-2.0.13 and python 3.6.10 on linux.

Thanks
Sergey

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions