def get_sql_ast(self) -> List:
    from olo.model import Model
    if (isinstance(self.left, type) and issubclass(self.left, Model)):
        left_ast = ['TABLE', self.left._get_table_name()]
    else:
        left_ast = self.left.get_sql_ast()
    on_ast = (self.on_.get_sql_ast() if self.on_ else [])
    return ['JOIN', self.type.name, left_ast, ['TABLE', self.right._get_table_name()], on_ast]
def get_sql_ast(self) -> List:
    from olo.model import Model
    if (isinstance(self.left, type) and issubclass(self.left, Model)):
        left_ast = ['TABLE', self.left._get_table_name()]
    else:
        left_ast = self.left.get_sql_ast()
    on_ast = (self.on_.get_sql_ast() if self.on_ else [])
    return ['JOIN', self.type.name, left_ast, ['TABLE', self.right._get_table_name()], on_ast]