本文整理汇总了Python中core.db.connection.DataHubConnection.list_table_permissions方法的典型用法代码示例。如果您正苦于以下问题:Python DataHubConnection.list_table_permissions方法的具体用法?Python DataHubConnection.list_table_permissions怎么用?Python DataHubConnection.list_table_permissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.db.connection.DataHubConnection
的用法示例。
在下文中一共展示了DataHubConnection.list_table_permissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from core.db.connection import DataHubConnection [as 别名]
# 或者: from core.db.connection.DataHubConnection import list_table_permissions [as 别名]
#.........这里部分代码省略.........
Raises ProgrammingError if the params has invalid values.
Raises PermissionDenied on insufficient permissions.
"""
return self.user_con.create_table(
repo=repo, table=table, params=params)
def list_tables(self, repo):
"""
Lists the tables in a repo.
Returns a list of table names.
Raises LookupError on insufficient permissions or if the repo doesn't
exist.
Raises ValueError if repo is invalid.
"""
return sorted(self.user_con.list_tables(repo=repo))
def describe_table(self, repo, table, detail=False):
"""
Lists a table's schema. If detail=True, provides all schema info.
Default return includes column names and types only.
Returns empty list on insufficient permissions.
Raises ValueError if repo or table are missing or the empty string.
"""
if repo.strip() in ['', None]:
raise ValueError("repo cannot be empty.")
if table.strip() in ['', None]:
raise ValueError("table cannot be empty.")
return self.user_con.describe_table(repo, table, detail)
def list_table_permissions(self, repo, table):
"""
Lists the current user's permissions on a table.
Default return includes column names and types only.
Returns empty list on insufficient permissions.
Raises ValueError if repo or table are missing or the empty string.
"""
if repo.strip() in ['', None]:
raise ValueError("repo cannot be empty.")
if table.strip() in ['', None]:
raise ValueError("table cannot be empty.")
return self.user_con.list_table_permissions(repo, table)
def create_view(self, repo, view, sql):
"""
Creates a view in the current repo_base from a given query.
Returns True on success.
Raises ValueError if repo or view have invalid characters.
Raises ProgrammingError if the repo doesn't exist.
Raises ProgrammingError if the view already exists.
Raises ProgrammingError if the query has syntax errors.
Raises PermissionDenied on insufficient permissions.
"""
return self.user_con.create_view(
repo=repo, view=view, sql=sql)
def list_views(self, repo):
"""
Lists the views in a repo.