owid.datautils.common#

Common objects shared by other modules.

exception datautils.common.ExceptionFromDocstring(exception_message: Optional[str] = None, *args: Any)[source]#

Bases: Exception

Exception that returns its own docstring, if no message is explicitly given.

datautils.common.warn_on_list_of_entities(list_of_entities: Union[List[Any], Set[Any]], warning_message: str, show_list: bool) None[source]#

Raise a warning with a custom message, and optionally print a list of affected elements.

Parameters
  • list_of_entities (list or set) – Elements to optionally print one by one (only relevant if show_list is True).

  • warning_message (str) – Warning message.

  • show_list (bool) – True to print a list of affected entities.