Skip to content

Commit

Permalink
MAINT: fix int32 default on windows issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed May 3, 2024
1 parent 4422b7e commit 48f272e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion astroquery/utils/tap/xmlparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import gzip
import io
import json
import warnings

import numpy as np

from astropy import units as u
from astropy.table import Table as APTable
Expand All @@ -38,7 +41,12 @@ def read_http_response(response, output_format, *, correct_units=True, use_names
result = APTable.read(io.BytesIO(gzip.decompress(data.read())), format=astropy_format,
use_names_over_ids=use_names_over_ids)
else:
result = APTable.read(io.BytesIO(gzip.decompress(data.read())), format=astropy_format)
with warnings.catch_warnings():
# Capturing the warning and converting the objid column to int64 is necessary for consistency as
# it was convereted to string on systems with defaul integer int32 due to an overflow.
result = APTable.read(io.BytesIO(gzip.decompress(data.read())), format=astropy_format)
if 'solution_id' in result.columns:
result['solution_id'] = result['solution_id'].astype(np.uint64)

except OSError:
# data is not a valid gzip file by BadGzipFile.
Expand Down

0 comments on commit 48f272e

Please sign in to comment.