Skip to content

Commit 11fcb7c

Browse files
jespinosaarbsipocz
authored andcommitted
eHST: remove warning in deprecated method, tap_client as variable
1 parent d126fd9 commit 11fcb7c

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

astroquery/esa/hubble/core.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,7 @@ def query_tap(self, query, *, async_job=False, output_file=None,
587587
table = job.get_results()
588588
return table
589589

590-
@deprecated(since="0.4.7", message=("Use of query_hst_tap method is no longer supported. "
591-
"Please use query_tap method instead, with the same arguments."),
592-
alternative="query_tap")
590+
@deprecated(since="0.4.7", alternative="query_tap")
593591
def query_hst_tap(self, query, *, async_job=False, output_file=None,
594592
output_format="votable", verbose=False):
595593
"""Launches a synchronous or asynchronous job to query the HST tap
@@ -613,10 +611,6 @@ def query_hst_tap(self, query, *, async_job=False, output_file=None,
613611
-------
614612
A table object
615613
"""
616-
warnings.warn(
617-
"Use of query_hst_tap method is no longer supported. Please use"
618-
" query_tap method instead, with the same arguments.",
619-
AstropyDeprecationWarning)
620614
self.query_tap(query=query, async_job=False, output_file=None,
621615
output_format="votable", verbose=False)
622616

astroquery/utils/tap/core.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
__all__ = ['Tap', 'TapPlus']
3535

3636
VERSION = "20200428.1"
37-
TAP_CLIENT_ID = f"aqtappy1-{VERSION}"
3837

3938

4039
class Tap:
@@ -138,6 +137,7 @@ def __init__(self, url=None,
138137

139138
def __internalInit(self):
140139
self.__connHandler = None
140+
self.tap_client_id = f"aqtappy1-{VERSION}"
141141

142142
def load_tables(self, verbose=False):
143143
"""Loads all public tables
@@ -585,7 +585,7 @@ def __launchJobMultipart(self, query, uploadResource, uploadTableName,
585585
"REQUEST": "doQuery",
586586
"LANG": "ADQL",
587587
"FORMAT": str(outputFormat),
588-
"tapclient": str(TAP_CLIENT_ID),
588+
"tapclient": str(self.tap_client_id),
589589
"QUERY": str(query),
590590
"UPLOAD": "" + str(uploadValue)}
591591
if maxrec is not None:
@@ -625,7 +625,7 @@ def __launchJob(self, query, outputFormat, context, verbose, name=None,
625625
"REQUEST": "doQuery",
626626
"LANG": "ADQL",
627627
"FORMAT": str(outputFormat),
628-
"tapclient": str(TAP_CLIENT_ID),
628+
"tapclient": str(self.tap_client_id),
629629
"QUERY": str(query)}
630630
if maxrec is not None:
631631
args['MAXREC'] = maxrec
@@ -799,11 +799,9 @@ def __internalInit(self):
799799
self.__pwd = None
800800
self.__isLoggedIn = False
801801

802-
@staticmethod
803-
def __set_client_id(client_id):
802+
def __set_client_id(self, client_id):
804803
if client_id:
805-
global TAP_CLIENT_ID
806-
TAP_CLIENT_ID = client_id
804+
self.tap_client_id = client_id
807805

808806
def load_tables(self, only_names=False, include_shared_tables=False,
809807
verbose=False):

0 commit comments

Comments
 (0)