def _check_no_current_table(new_obj, current_table):
    if current_table is None:
        msg = 'Cannot add {} before adding table'
        if isinstance(new_obj, Relation):
            raise NoCurrentTableException(msg.format('relation'))
        if isinstance(new_obj, Column):
            raise NoCurrentTableException(msg.format('column'))
Raises exception if we try to add a relation or a column
dataset/ETHPy150Open Alexis-benoist/eralchemy/eralchemy/parser.py/_check_no_current_table