@@ -102,17 +102,22 @@ def query(self, query, *, output_file=None, output_format="votable", verbose=Fal
102
102
output_format : str, optional, default 'votable'
103
103
possible values 'votable' or 'csv'
104
104
verbose : bool, optional, default 'False'
105
- flag to display information about the process
105
+ flag to display information about the process and warnings when
106
+ the data doesn't conform to its standard.
106
107
107
108
Returns
108
109
-------
109
110
A table object
110
111
"""
111
112
if not verbose :
112
- commons .suppress_vo_warnings ()
113
- warnings .filterwarnings ("ignore" , category = astropy .units .core .UnitsWarning )
114
- job = self ._tap .launch_job (query = query , output_file = output_file , output_format = output_format , verbose = verbose ,
115
- dump_to_file = output_file is not None )
113
+ with warnings .catch_warnings ():
114
+ commons .suppress_vo_warnings ()
115
+ warnings .filterwarnings ("ignore" , category = astropy .units .core .UnitsWarning )
116
+ job = self ._tap .launch_job (query = query , output_file = output_file , output_format = output_format ,
117
+ verbose = verbose , dump_to_file = output_file is not None )
118
+ else :
119
+ job = self ._tap .launch_job (query = query , output_file = output_file , output_format = output_format ,
120
+ verbose = verbose , dump_to_file = output_file is not None )
116
121
return job .get_results ()
117
122
118
123
def get_tables (self , * , only_names = True , verbose = False , cache = True ):
0 commit comments