|
15 | 15 | """
|
16 | 16 | import getpass
|
17 | 17 | import os
|
18 |
| -import requests |
19 | 18 | import tempfile
|
20 |
| -from astropy.table.table import Table |
21 | 19 | from urllib.parse import urlencode
|
22 | 20 |
|
| 21 | +import requests |
| 22 | +from astropy.table.table import Table |
| 23 | + |
23 | 24 | from astroquery import log
|
24 | 25 | from astroquery.utils.tap import taputils
|
25 | 26 | from astroquery.utils.tap.conn.tapconn import TapConn
|
@@ -1342,7 +1343,8 @@ def upload_table(self, *, upload_resource=None, table_name=None, table_descripti
|
1342 | 1343 | table_description : str, optional, default None
|
1343 | 1344 | table description
|
1344 | 1345 | format : str, optional, default 'votable'
|
1345 |
| - resource format |
| 1346 | + resource format. Only formats described in |
| 1347 | + https://docs.astropy.org/en/stable/io/unified.html#built-in-table-readers-writers are accepted. |
1346 | 1348 | verbose : bool, optional, default 'False'
|
1347 | 1349 | flag to display information about the process
|
1348 | 1350 | """
|
@@ -1415,7 +1417,7 @@ def __uploadTableMultipart(self, resource, *, table_name=None, table_description
|
1415 | 1417 | chunk = f.read()
|
1416 | 1418 | files = [['FILE', os.path.basename(resource), chunk]]
|
1417 | 1419 | else:
|
1418 |
| - table = Table.read(str(resource)) |
| 1420 | + table = Table.read(str(resource), format=resource_format) |
1419 | 1421 | fh = tempfile.NamedTemporaryFile(delete=False)
|
1420 | 1422 | table.write(fh, format='votable')
|
1421 | 1423 | fh.close()
|
|
0 commit comments