Skip to content

Commit

Permalink
GAIAPCR-1313 Make use of astropy_format to check if the format is a v…
Browse files Browse the repository at this point in the history
…otable
  • Loading branch information
Jorge Fernandez Hernandez authored and Jorge Fernandez Hernandez committed May 1, 2024
1 parent b0d4cbe commit 13c8ba6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion astroquery/utils/tap/model/modelutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def check_file_exists(file_name):


def read_results_table_from_file(file_name, output_format, *, correct_units=True, use_names_over_ids=False):

astropy_format = utils.get_suitable_astropy_format(output_format)

if check_file_exists(file_name):
Expand Down Expand Up @@ -65,7 +66,7 @@ def read_results_table_from_file(file_name, output_format, *, correct_units=True
return result

else:
if output_format == 'votable':
if astropy_format == 'votable':
result = APTable.read(file_name, format=astropy_format, use_names_over_ids=use_names_over_ids)
else:
result = APTable.read(file_name, format=astropy_format)
Expand Down
4 changes: 2 additions & 2 deletions astroquery/utils/tap/xmlparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read_http_response(response, output_format, *, correct_units=True, use_names
data = io.BytesIO(response.read())

try:
if output_format == 'votable':
if astropy_format == 'votable':
result = APTable.read(io.BytesIO(gzip.decompress(data.read())), format=astropy_format,
use_names_over_ids=use_names_over_ids)
else:
Expand Down Expand Up @@ -66,7 +66,7 @@ def read_http_response(response, output_format, *, correct_units=True, use_names
else:
result = APTable.read(data, format=astropy_format)

elif output_format == 'votable':
elif astropy_format == 'votable':
result = APTable.read(data, format=astropy_format, use_names_over_ids=use_names_over_ids)
else:
result = APTable.read(data, format=astropy_format)
Expand Down

0 comments on commit 13c8ba6

Please sign in to comment.