You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 'ps' and 'pscomppars' are the main tables of detected exoplanets. Calls to the old tables ('exoplanets', 'compositepars', 'exomultpars') will return errors and urge the user to call the 'ps' or 'pscomppars' tables
MAP_TABLEWARNINGS= {"exoplanets": "Planetary Systems (PS)",
91
+
"compositepars": "Planetary System Composite Parameters table (PSCompPars)",
92
+
"exomultpars": "Planetary Systems (PS)"}
90
93
91
94
92
95
defget_access_url(service='tap'):
@@ -111,17 +114,20 @@ class InvalidTableError(InvalidQueryError):
111
114
pass
112
115
113
116
114
-
# Class decorator, async_to_sync, modifies NasaExoplanetArchiveClass to convert all query_x_async methods to query_x methods
117
+
# Class decorator, async_to_sync, modifies NasaExoplanetArchiveClass to convert
118
+
# all query_x_async methods to query_x methods
115
119
@async_to_sync
116
120
classNasaExoplanetArchiveClass(BaseQuery):
117
121
"""
118
122
The interface for querying the NASA Exoplanet Archive TAP and API services
119
123
120
124
A full discussion of the available tables and query syntax is available on the documentation
121
-
pages for `TAP <https://exoplanetarchive.ipac.caltech.edu/docs/TAP/usingTAP.html>`_ and `API <https://exoplanetarchive.ipac.caltech.edu/docs/program_interfaces.html>`_.
125
+
pages for `TAP <https://exoplanetarchive.ipac.caltech.edu/docs/TAP/usingTAP.html>`_ and
# When module us imported, __init__.py runs and loads a configuration object, setting the configuration parameters con.url, conf.timeout and conf.cache
129
+
# When module us imported, __init__.py runs and loads a configuration object,
130
+
# setting the configuration parameters con.url, conf.timeout and conf.cache
# warnings.warn("The '{0}' table is stale and will be depracated in the Archive 2.0 release. Use the 'ps' table. See https://exoplanetarchive.ipac.caltech.edu/docs/ps-pscp_release_notes.html".format(table), InputWarning, )
180
-
raiseInvalidTableError("The ``{0}`` table is no longer updated and has been replaced by the {1} table, which is connected to the Exoplanet Archive TAP service. Although the argument keywords of the called method should still work on the new table, the allowed values could have changed since the database column names have changed; this document contains the current definitions and a mapping between the new and deprecated names: https://exoplanetarchive.ipac.caltech.edu/docs/API_PS_columns.html. You might also want to review the TAP User Guide for help on creating a new query for the most current data: https://exoplanetarchive.ipac.caltech.edu/docs/TAP/usingTAP.html.".format(table, MAP_TABLEWARNINGS[table]))
185
+
raiseInvalidTableError(
186
+
"The `{0}` table is no longer updated and has been replacedby the `{1}` table, which"
187
+
" is connected to the Exoplanet Archive TAP service. Although the argument keywords "
188
+
"of the called method should still work on the new table, the allowed values could "
189
+
"have changed since the database column names have changed; this document contains "
190
+
"the current definitions and a mapping between the new and deprecated names: "
191
+
"https://exoplanetarchive.ipac.caltech.edu/docs/API_PS_columns.html. You might also "
192
+
"want to review the TAP User Guide for help on creating a new query for the most "
# if table.lower() in ["ps"]: # actually want to check if default was used, but wasn't working ...
329
-
# warnings.warn("The default table for this query method has changed after Archive 2.0 release. The ``ps`` table is being used, and is likely to return multiple rows for an object query. See https://exoplanetarchive.ipac.caltech.edu/docs/API_PS_columns.html", InputWarning, )
330
343
331
344
prefix=OBJECT_TABLES.get(table, None)
332
345
ifprefixisNone:
333
-
raiseInvalidQueryError(
334
-
"Invalid table '{0}'. The allowed options are: 'ps' and 'pscomppars'".format(
335
-
table
336
-
)
337
-
)
346
+
raiseInvalidQueryError(f"Invalid table '{table}'. The allowed options are: 'ps' and 'pscomppars'")
if"pl_hostname"inrequest_payload["where"]: # means this is a `query_object`
623
-
request_payload["where"] ="pl_hostname or pl_name like {0}".format(request_payload["where"][request_payload["where"].find("=")+2:request_payload["where"].find("OR")-2]) # This is a bit hacky since we are getting this from the request_payload (downstream) instead of directly from object_name
631
+
# This is a bit hacky since we are getting this from the request_payload (downstream)
0 commit comments