Skip to content
Snippets Groups Projects
Commit 2d135a3f authored by Hugh Dickinson's avatar Hugh Dickinson
Browse files

Merge branch 'esap-general#54' into 'master'

Replace warning() with warnings.warn()

See merge request astron-sdc/esap-userprofile-python-client!4
parents 746f46d5 34763f48
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import getpass
import pandas as pd
from typing import Union, Optional
from warnings import warn
class shopping_client:
......@@ -124,7 +125,7 @@ class shopping_client:
name: data.to_frame().T if data.ndim < 2 else data.T
for name, data in converted_basket.items()
}
warning(
warn(
"No archive connectors specified - could not convert any basket items to Pandas DataFrame"
)
return self.basket
......
......@@ -5,6 +5,7 @@ import getpass
import pandas as pd
from typing import Union, Optional
from warnings import warn
from panoptes_client import Panoptes, Project, Workflow
from panoptes_client.panoptes import PanoptesAPIException
......@@ -135,7 +136,7 @@ class zooniverse:
)
else:
if not generate:
warning(
warn(
"Requested resource is not available and you have specified generate==False"
)
return None
......@@ -143,7 +144,7 @@ class zooniverse:
print("Generating requested export...")
response = self.generate(item, wait)
if response is None:
warning("No data immediately available. Returning NoneType")
warn("No data immediately available. Returning NoneType")
return None
if response.ok:
if convert_to_pandas:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment