Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
grant_option | (self, table_type, privilege, node=None) | Check that user is able to execute GRANT and REVOKE privilege statements if and only if they have the privilege WITH GRANT OPTION,
either directly or through a role.
| Check that user is able to execute GRANT and REVOKE privilege statements if and only if they have the privilege WITH GRANT OPTION,
either directly or through a role.
| def grant_option(self, table_type, privilege, node=None):
"""Check that user is able to execute GRANT and REVOKE privilege statements if and only if they have the privilege WITH GRANT OPTION,
either directly or through a role.
"""
user0_name = f"user0_{getuid()}"
user1_name = f"user1_{getuid()}"
... | [
"def",
"grant_option",
"(",
"self",
",",
"table_type",
",",
"privilege",
",",
"node",
"=",
"None",
")",
":",
"user0_name",
"=",
"f\"user0_{getuid()}\"",
"user1_name",
"=",
"f\"user1_{getuid()}\"",
"role0_name",
"=",
"f\"role0_{getuid()}\"",
"role1_name",
"=",
"f\"ro... | [
8,
0
] | [
41,
168
] | python | en | ['en', 'en', 'en'] | True |
grant_option_check | (grant_option_target, grant_target, user_name, table_type, privilege, node=None) | Run different scenarios to check the user's access with different privileges.
| Run different scenarios to check the user's access with different privileges.
| def grant_option_check(grant_option_target, grant_target, user_name, table_type, privilege, node=None):
"""Run different scenarios to check the user's access with different privileges.
"""
exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
with Scenario("grant by user without privile... | [
"def",
"grant_option_check",
"(",
"grant_option_target",
",",
"grant_target",
",",
"user_name",
",",
"table_type",
",",
"privilege",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
... | [
43,
0
] | [
80,
55
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1", stress=None, parallel=None) | Check the RBAC functionality of privileges with GRANT OPTION.
| Check the RBAC functionality of privileges with GRANT OPTION.
| def feature(self, node="clickhouse1", stress=None, parallel=None):
"""Check the RBAC functionality of privileges with GRANT OPTION.
"""
self.context.node = self.context.cluster.node(node)
if parallel is not None:
self.context.parallel = parallel
if stress is not None:
self.context.s... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
",",
"stress",
"=",
"None",
",",
"parallel",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
... | [
116,
0
] | [
133,
23
] | python | en | ['en', 'en', 'en'] | True |
prune_distance_matrix | (refList, remove_seqs_in, distMat, output) | Rebuild distance matrix following selection of panel of references
Args:
refList (list)
List of sequences used to generate distance matrix
remove_seqs_in (list)
List of sequences to be omitted
distMat (numpy.array)
nx2 matrix of core distances (column 0) ... | Rebuild distance matrix following selection of panel of references | def prune_distance_matrix(refList, remove_seqs_in, distMat, output):
"""Rebuild distance matrix following selection of panel of references
Args:
refList (list)
List of sequences used to generate distance matrix
remove_seqs_in (list)
List of sequences to be omitted
... | [
"def",
"prune_distance_matrix",
"(",
"refList",
",",
"remove_seqs_in",
",",
"distMat",
",",
"output",
")",
":",
"# Find list items to remove",
"remove_seqs_list",
"=",
"[",
"]",
"removal_indices",
"=",
"[",
"]",
"for",
"to_remove",
"in",
"remove_seqs_in",
":",
"fo... | [
20,
0
] | [
92,
33
] | python | en | ['en', 'en', 'en'] | True |
calc_errors | (
output: torch.Tensor, target: torch.Tensor, topk: Tuple[int, ...] = (1,)
) | Calculate top-k errors over output from architecture (model).
Args:
output (torch.Tensor): Output tensor from architecture (model).
target (torch.Tensor): Training target tensor.
topk (Tuple[int, ...]): Tuple of int which you want to know error.
Returns:
List[torch.Tensor]: lis... | Calculate top-k errors over output from architecture (model). | def calc_errors(
output: torch.Tensor, target: torch.Tensor, topk: Tuple[int, ...] = (1,)
) -> List[torch.Tensor]:
"""Calculate top-k errors over output from architecture (model).
Args:
output (torch.Tensor): Output tensor from architecture (model).
target (torch.Tensor): Training target te... | [
"def",
"calc_errors",
"(",
"output",
":",
"torch",
".",
"Tensor",
",",
"target",
":",
"torch",
".",
"Tensor",
",",
"topk",
":",
"Tuple",
"[",
"int",
",",
"...",
"]",
"=",
"(",
"1",
",",
")",
")",
"->",
"List",
"[",
"torch",
".",
"Tensor",
"]",
... | [
13,
0
] | [
43,
21
] | python | en | ['en', 'en', 'en'] | True |
eval_mean_errors | (
arch: nn.Module,
loader: DataLoader,
device: torch.device,
topk: Tuple[int, ...] = (1,),
) | Evaluate top-k mean errors of the architecture over given dataloader.
Args:
arch (nn.Module): An architecture to be evaluated.
loader (DataLoader): A dataloader.
device (torch.device): A device used for calculation.
topk (Tuple[int, ...]): Tuple of int which you want to know error.
... | Evaluate top-k mean errors of the architecture over given dataloader. | def eval_mean_errors(
arch: nn.Module,
loader: DataLoader,
device: torch.device,
topk: Tuple[int, ...] = (1,),
) -> List[float]:
"""Evaluate top-k mean errors of the architecture over given dataloader.
Args:
arch (nn.Module): An architecture to be evaluated.
loader (DataLoader):... | [
"def",
"eval_mean_errors",
"(",
"arch",
":",
"nn",
".",
"Module",
",",
"loader",
":",
"DataLoader",
",",
"device",
":",
"torch",
".",
"device",
",",
"topk",
":",
"Tuple",
"[",
"int",
",",
"...",
"]",
"=",
"(",
"1",
",",
")",
",",
")",
"->",
"List... | [
46,
0
] | [
74,
66
] | python | en | ['en', 'en', 'en'] | True |
one_external_user_directory | (self, node="clickhouse1") | Check that we can restart ClickHouse server when one
LDAP external user directory is configured.
| Check that we can restart ClickHouse server when one
LDAP external user directory is configured.
| def one_external_user_directory(self, node="clickhouse1"):
"""Check that we can restart ClickHouse server when one
LDAP external user directory is configured.
"""
self.context.node = self.context.cluster.node(node)
servers = {
"openldap1": {
"host": "openldap1",
"por... | [
"def",
"one_external_user_directory",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"servers",
"=",
"{",
"\"openldap1\"",
":",
... | [
10,
0
] | [
36,
79
] | python | en | ['en', 'en', 'en'] | True |
multiple_external_user_directories | (self, node="clickhouse1") | Check that we can restart ClickHouse server when two
LDAP external user directory are configured.
| Check that we can restart ClickHouse server when two
LDAP external user directory are configured.
| def multiple_external_user_directories(self, node="clickhouse1"):
"""Check that we can restart ClickHouse server when two
LDAP external user directory are configured.
"""
self.context.node = self.context.cluster.node(node)
servers = {
"openldap1": {
"host": "openldap1",
... | [
"def",
"multiple_external_user_directories",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"servers",
"=",
"{",
"\"openldap1\"",
... | [
39,
0
] | [
87,
75
] | python | en | ['en', 'en', 'en'] | True |
dynamically_added_users | (self, node="clickhouse1", count=10) | Check that we can restart ClickHouse server when one
LDAP external user directory is configured and the login
with an LDAP users that are dynamically added after restart.
| Check that we can restart ClickHouse server when one
LDAP external user directory is configured and the login
with an LDAP users that are dynamically added after restart.
| def dynamically_added_users(self, node="clickhouse1", count=10):
"""Check that we can restart ClickHouse server when one
LDAP external user directory is configured and the login
with an LDAP users that are dynamically added after restart.
"""
self.context.node = self.context.cluster.node(node)
... | [
"def",
"dynamically_added_users",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
",",
"count",
"=",
"10",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"servers",
"=",
"{",... | [
90,
0
] | [
130,
123
] | python | en | ['en', 'en', 'en'] | True |
parallel_login | (self, server=None, user_count=10, timeout=300) | Check that login of valid and invalid users works in parallel
using local users defined using RBAC and LDAP users authenticated using
multiple LDAP external user directories when server is restarted
in the middle of parallel login attempts. After server is restarted
makes sure that parallel logins work ... | Check that login of valid and invalid users works in parallel
using local users defined using RBAC and LDAP users authenticated using
multiple LDAP external user directories when server is restarted
in the middle of parallel login attempts. After server is restarted
makes sure that parallel logins work ... | def parallel_login(self, server=None, user_count=10, timeout=300):
"""Check that login of valid and invalid users works in parallel
using local users defined using RBAC and LDAP users authenticated using
multiple LDAP external user directories when server is restarted
in the middle of parallel login att... | [
"def",
"parallel_login",
"(",
"self",
",",
"server",
"=",
"None",
",",
"user_count",
"=",
"10",
",",
"timeout",
"=",
"300",
")",
":",
"servers",
"=",
"{",
"\"openldap1\"",
":",
"{",
"\"host\"",
":",
"\"openldap1\"",
",",
"\"port\"",
":",
"\"389\"",
",",
... | [
136,
0
] | [
285,
56
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, servers=None, server=None, node="clickhouse1") | Check that we can restart ClickHouse server
when one or more external user directories are configured.
| Check that we can restart ClickHouse server
when one or more external user directories are configured.
| def feature(self, servers=None, server=None, node="clickhouse1"):
"""Check that we can restart ClickHouse server
when one or more external user directories are configured.
"""
self.context.node = self.context.cluster.node(node)
for scenario in loads(current_module(), Scenario):
Scenario(tes... | [
"def",
"feature",
"(",
"self",
",",
"servers",
"=",
"None",
",",
"server",
"=",
"None",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
... | [
292,
0
] | [
299,
33
] | python | en | ['en', 'en', 'en'] | True |
_GetJavaVersionString | () | Get the version string from the Java VM. | Get the version string from the Java VM. | def _GetJavaVersionString():
"""Get the version string from the Java VM."""
return subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT) | [
"def",
"_GetJavaVersionString",
"(",
")",
":",
"return",
"subprocess",
".",
"check_output",
"(",
"[",
"'java'",
",",
"'-version'",
"]",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
")"
] | [
32,
0
] | [
34,
80
] | python | en | ['en', 'en', 'en'] | True |
_ParseJavaVersion | (version_string) | Returns a 2-tuple for the current version of Java installed.
Args:
version_string: String of the Java version (e.g. '1.7.2-ea').
Returns:
The major and minor versions, as a 2-tuple (e.g. (1, 7)).
| Returns a 2-tuple for the current version of Java installed. | def _ParseJavaVersion(version_string):
"""Returns a 2-tuple for the current version of Java installed.
Args:
version_string: String of the Java version (e.g. '1.7.2-ea').
Returns:
The major and minor versions, as a 2-tuple (e.g. (1, 7)).
"""
match = _VERSION_REGEX.search(version_string)
if match:
... | [
"def",
"_ParseJavaVersion",
"(",
"version_string",
")",
":",
"match",
"=",
"_VERSION_REGEX",
".",
"search",
"(",
"version_string",
")",
"if",
"match",
":",
"version",
"=",
"tuple",
"(",
"int",
"(",
"x",
"or",
"0",
")",
"for",
"x",
"in",
"match",
".",
"... | [
37,
0
] | [
50,
18
] | python | en | ['en', 'en', 'en'] | True |
_JavaSupports32BitMode | () | Determines whether the JVM supports 32-bit mode on the platform. | Determines whether the JVM supports 32-bit mode on the platform. | def _JavaSupports32BitMode():
"""Determines whether the JVM supports 32-bit mode on the platform."""
# Suppresses process output to stderr and stdout from showing up in the
# console as we're only trying to determine 32-bit JVM support.
supported = False
try:
devnull = open(os.devnull, 'wb')
return su... | [
"def",
"_JavaSupports32BitMode",
"(",
")",
":",
"# Suppresses process output to stderr and stdout from showing up in the",
"# console as we're only trying to determine 32-bit JVM support.",
"supported",
"=",
"False",
"try",
":",
"devnull",
"=",
"open",
"(",
"os",
".",
"devnull",
... | [
53,
0
] | [
66,
18
] | python | en | ['en', 'en', 'en'] | True |
_GetJsCompilerArgs | (compiler_jar_path, java_version, jvm_flags) | Assembles arguments for call to JsCompiler. | Assembles arguments for call to JsCompiler. | def _GetJsCompilerArgs(compiler_jar_path, java_version, jvm_flags):
"""Assembles arguments for call to JsCompiler."""
if java_version < (1, 7):
raise JsCompilerError('Closure Compiler requires Java 1.7 or higher. '
'Please visit http://www.java.com/getjava')
args = ['java']
# Ad... | [
"def",
"_GetJsCompilerArgs",
"(",
"compiler_jar_path",
",",
"java_version",
",",
"jvm_flags",
")",
":",
"if",
"java_version",
"<",
"(",
"1",
",",
"7",
")",
":",
"raise",
"JsCompilerError",
"(",
"'Closure Compiler requires Java 1.7 or higher. '",
"'Please visit http://ww... | [
69,
0
] | [
96,
13
] | python | en | ['en', 'en', 'en'] | True |
_GetFlagFile | (source_paths, compiler_flags) | Writes given source paths and compiler flags to a --flagfile.
The given source_paths will be written as '--js' flags and the compiler_flags
are written as-is.
Args:
source_paths: List of string js source paths.
compiler_flags: List of string compiler flags.
Returns:
The file to which the flags we... | Writes given source paths and compiler flags to a --flagfile. | def _GetFlagFile(source_paths, compiler_flags):
"""Writes given source paths and compiler flags to a --flagfile.
The given source_paths will be written as '--js' flags and the compiler_flags
are written as-is.
Args:
source_paths: List of string js source paths.
compiler_flags: List of string compiler ... | [
"def",
"_GetFlagFile",
"(",
"source_paths",
",",
"compiler_flags",
")",
":",
"args",
"=",
"[",
"]",
"for",
"path",
"in",
"source_paths",
":",
"args",
"+=",
"[",
"'--js'",
",",
"path",
"]",
"# Add compiler flags, if any.",
"if",
"compiler_flags",
":",
"args",
... | [
99,
0
] | [
124,
19
] | python | en | ['en', 'en', 'en'] | True |
Compile | (compiler_jar_path,
source_paths,
jvm_flags=None,
compiler_flags=None) | Prepares command-line call to Closure Compiler.
Args:
compiler_jar_path: Path to the Closure compiler .jar file.
source_paths: Source paths to build, in order.
jvm_flags: A list of additional flags to pass on to JVM.
compiler_flags: A list of additional flags to pass on to Closure Compiler.
Return... | Prepares command-line call to Closure Compiler. | def Compile(compiler_jar_path,
source_paths,
jvm_flags=None,
compiler_flags=None):
"""Prepares command-line call to Closure Compiler.
Args:
compiler_jar_path: Path to the Closure compiler .jar file.
source_paths: Source paths to build, in order.
jvm_flags: A list of ... | [
"def",
"Compile",
"(",
"compiler_jar_path",
",",
"source_paths",
",",
"jvm_flags",
"=",
"None",
",",
"compiler_flags",
"=",
"None",
")",
":",
"java_version",
"=",
"_ParseJavaVersion",
"(",
"str",
"(",
"_GetJavaVersionString",
"(",
")",
")",
")",
"args",
"=",
... | [
127,
0
] | [
160,
30
] | python | en | ['en', 'pt', 'en'] | True |
bit_int_inline | (self, func, supported, error, int_type, min, max, node=None) | Check bit functions with Int128, UInt128, Int256, and UInt256 using inline tests.
| Check bit functions with Int128, UInt128, Int256, and UInt256 using inline tests.
| def bit_int_inline(self, func, supported, error, int_type, min, max, node=None):
""" Check bit functions with Int128, UInt128, Int256, and UInt256 using inline tests.
"""
if error is not None:
exitcode,message = error
if node is None:
node = self.context.node
if func in ["bitNot",... | [
"def",
"bit_int_inline",
"(",
"self",
",",
"func",
",",
"supported",
",",
"error",
",",
"int_type",
",",
"min",
",",
"max",
",",
"node",
"=",
"None",
")",
":",
"if",
"error",
"is",
"not",
"None",
":",
"exitcode",
",",
"message",
"=",
"error",
"if",
... | [
24,
0
] | [
52,
53
] | python | en | ['en', 'en', 'en'] | True |
bit_int_table | (self, func, supported, error, int_type, min, max, node=None) | Check bit functions with Int128, UInt128, Int256, and UInt256 using table tests.
| Check bit functions with Int128, UInt128, Int256, and UInt256 using table tests.
| def bit_int_table(self, func, supported, error, int_type, min, max, node=None):
""" Check bit functions with Int128, UInt128, Int256, and UInt256 using table tests.
"""
table_name = f"table_{getuid()}"
if node is None:
node = self.context.node
if error is not None:
exitcode,messag... | [
"def",
"bit_int_table",
"(",
"self",
",",
"func",
",",
"supported",
",",
"error",
",",
"int_type",
",",
"min",
",",
"max",
",",
"node",
"=",
"None",
")",
":",
"table_name",
"=",
"f\"table_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"se... | [
56,
0
] | [
101,
55
] | python | en | ['en', 'en', 'en'] | True |
bit_dec_inline | (self, func, supported, error, node=None) | Check bit functions with Decimal256 using inline tests.
| Check bit functions with Decimal256 using inline tests.
| def bit_dec_inline(self, func, supported, error, node=None):
""" Check bit functions with Decimal256 using inline tests.
"""
min = Decimal256_min_max[0]
max = Decimal256_min_max[1]
exitcode, message = illegal_type()
if node is None:
node = self.context.node
if func in ["bitNot", "... | [
"def",
"bit_dec_inline",
"(",
"self",
",",
"func",
",",
"supported",
",",
"error",
",",
"node",
"=",
"None",
")",
":",
"min",
"=",
"Decimal256_min_max",
"[",
"0",
"]",
"max",
"=",
"Decimal256_min_max",
"[",
"1",
"]",
"exitcode",
",",
"message",
"=",
"i... | [
105,
0
] | [
126,
53
] | python | en | ['en', 'en', 'en'] | True |
bit_dec_table | (self, func, supported, error, node=None) | Check bit functions with Decimal256 using table tests.
| Check bit functions with Decimal256 using table tests.
| def bit_dec_table(self, func, supported, error, node=None):
""" Check bit functions with Decimal256 using table tests.
"""
min = Decimal256_min_max[0]
max = Decimal256_min_max[1]
table_name = f"table_{getuid()}"
exitcode, message = illegal_type()
if node is None:
node = self.contex... | [
"def",
"bit_dec_table",
"(",
"self",
",",
"func",
",",
"supported",
",",
"error",
",",
"node",
"=",
"None",
")",
":",
"min",
"=",
"Decimal256_min_max",
"[",
"0",
"]",
"max",
"=",
"Decimal256_min_max",
"[",
"1",
"]",
"table_name",
"=",
"f\"table_{getuid()}\... | [
130,
0
] | [
159,
55
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1", mysql_node="mysql1", stress=None, parallel=None) | Check that bit functions work with extended precision data types.
| Check that bit functions work with extended precision data types.
| def feature(self, node="clickhouse1", mysql_node="mysql1", stress=None, parallel=None):
"""Check that bit functions work with extended precision data types.
"""
self.context.node = self.context.cluster.node(node)
self.context.mysql_node = self.context.cluster.node(mysql_node)
with allow_experimenta... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
",",
"mysql_node",
"=",
"\"mysql1\"",
",",
"stress",
"=",
"None",
",",
"parallel",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluste... | [
168,
0
] | [
178,
35
] | python | en | ['en', 'en', 'en'] | True |
get_tag_suffix | (branch:str, tag:str) | return a tag suffix based on branch and tag name
| return a tag suffix based on branch and tag name
| def get_tag_suffix(branch:str, tag:str) -> str:
''' return a tag suffix based on branch and tag name
'''
tag_suffix = '-'
if RE_DEVEL_BRANCH.match(branch):
tag_suffix += 'devel'
elif RE_MASTER_BRANCH.match(branch):
tag_suffix += 'pre-release'
elif RE_FEATURE_BRANCH.match(branch) ... | [
"def",
"get_tag_suffix",
"(",
"branch",
":",
"str",
",",
"tag",
":",
"str",
")",
"->",
"str",
":",
"tag_suffix",
"=",
"'-'",
"if",
"RE_DEVEL_BRANCH",
".",
"match",
"(",
"branch",
")",
":",
"tag_suffix",
"+=",
"'devel'",
"elif",
"RE_MASTER_BRANCH",
".",
"... | [
8,
0
] | [
21,
21
] | python | en | ['en', 'en', 'en'] | True |
test_alter_multiple_ttls | (started_cluster, name, engine, positive) | Copyright 2019, Altinity LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | Copyright 2019, Altinity LTD | def test_alter_multiple_ttls(started_cluster, name, engine, positive):
name = unique_table_name(name)
"""Copyright 2019, Altinity LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
ht... | [
"def",
"test_alter_multiple_ttls",
"(",
"started_cluster",
",",
"name",
",",
"engine",
",",
"positive",
")",
":",
"name",
"=",
"unique_table_name",
"(",
"name",
")",
"\"\"\"Check that when multiple TTL expressions are set\n and before any parts are inserted the TTL expressions... | [
778,
0
] | [
866,
77
] | python | en | ['en', 'pl', 'en'] | True |
test_alter_with_merge_work | (started_cluster, name, engine, positive) | Copyright 2019, Altinity LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | Copyright 2019, Altinity LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | def test_alter_with_merge_work(started_cluster, name, engine, positive):
name = unique_table_name(name)
"""Copyright 2019, Altinity LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
ht... | [
"def",
"test_alter_with_merge_work",
"(",
"started_cluster",
",",
"name",
",",
"engine",
",",
"positive",
")",
":",
"name",
"=",
"unique_table_name",
"(",
"name",
")",
"\"\"\"Check that TTL expressions are re-evaluated for\n existing parts after ALTER command changes TTL expre... | [
1047,
0
] | [
1129,
77
] | python | en | ['en', 'pl', 'en'] | True |
matches | (value, pattern) | Check whether `value` matches `pattern`.
Parameters
----------
value : ast.AST
pattern : ast.AST
Returns
-------
matched : bool
| Check whether `value` matches `pattern`. | def matches(value, pattern):
"""Check whether `value` matches `pattern`.
Parameters
----------
value : ast.AST
pattern : ast.AST
Returns
-------
matched : bool
"""
# types must match exactly
if type(value) != type(pattern):
return False
# primitive value, such ... | [
"def",
"matches",
"(",
"value",
",",
"pattern",
")",
":",
"# types must match exactly",
"if",
"type",
"(",
"value",
")",
"!=",
"type",
"(",
"pattern",
")",
":",
"return",
"False",
"# primitive value, such as None, True, False etc",
"if",
"not",
"isinstance",
"(",
... | [
3,
0
] | [
30,
15
] | python | en | ['en', 'en', 'en'] | True |
privilege_granted_directly_or_via_role | (self, node=None) | Check that user is only able to execute ATTACH TEMPORARY TABLE when they have required privilege, either directly or via role.
| Check that user is only able to execute ATTACH TEMPORARY TABLE when they have required privilege, either directly or via role.
| def privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is only able to execute ATTACH TEMPORARY TABLE when they have required privilege, either directly or via role.
"""
role_name = f"role_{getuid()}"
user_name = f"user_{getuid()}"
if node is None:
node = self.conte... | [
"def",
"privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"role_name",
"=",
"f\"role_{getuid()}\"",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node... | [
5,
0
] | [
27,
92
] | python | en | ['en', 'en', 'en'] | True |
privilege_check | (grant_target_name, user_name, node=None) | Run scenarios to check the user's access with different privileges.
| Run scenarios to check the user's access with different privileges.
| def privilege_check(grant_target_name, user_name, node=None):
"""Run scenarios to check the user's access with different privileges.
"""
exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
with Scenario("user without privilege"):
temp_table_name = f"temp_table_{getuid()}"
... | [
"def",
"privilege_check",
"(",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
"f\"{user_name}\"",
")",
"with",
"Scenario",
"(",
"\"user without... | [
29,
0
] | [
114,
79
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1", stress=None, parallel=None) | Check the RBAC functionality of ATTACH TEMPORARY TABLE.
| Check the RBAC functionality of ATTACH TEMPORARY TABLE.
| def feature(self, node="clickhouse1", stress=None, parallel=None):
"""Check the RBAC functionality of ATTACH TEMPORARY TABLE.
"""
self.context.node = self.context.cluster.node(node)
if parallel is not None:
self.context.parallel = parallel
if stress is not None:
self.context.stress ... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
",",
"stress",
"=",
"None",
",",
"parallel",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
... | [
123,
0
] | [
134,
48
] | python | en | ['en', 'en', 'en'] | True |
_generate_tokens | (pat, text) | Generate a sequence of tokens from `text` that match `pat`
Parameters
----------
pat : compiled regex
The pattern to use for tokenization
text : str
The text to tokenize
| Generate a sequence of tokens from `text` that match `pat` | def _generate_tokens(pat, text):
"""Generate a sequence of tokens from `text` that match `pat`
Parameters
----------
pat : compiled regex
The pattern to use for tokenization
text : str
The text to tokenize
"""
rules = _TYPE_RULES
keys = _TYPE_KEYS
groupindex = pat.gr... | [
"def",
"_generate_tokens",
"(",
"pat",
",",
"text",
")",
":",
"rules",
"=",
"_TYPE_RULES",
"keys",
"=",
"_TYPE_KEYS",
"groupindex",
"=",
"pat",
".",
"groupindex",
"for",
"m",
"in",
"iter",
"(",
"pat",
".",
"scanner",
"(",
"text",
")",
".",
"match",
","... | [
802,
0
] | [
819,
44
] | python | en | ['en', 'en', 'en'] | True |
cast | (source, target, **kwargs) | Attempts to implicitly cast from source dtype to target dtype | Attempts to implicitly cast from source dtype to target dtype | def cast(source, target, **kwargs):
"""Attempts to implicitly cast from source dtype to target dtype"""
source, target = dtype(source), dtype(target)
if not castable(source, target, **kwargs):
raise com.IbisTypeError('Datatype {} cannot be implicitly '
'casted to {}'... | [
"def",
"cast",
"(",
"source",
",",
"target",
",",
"*",
"*",
"kwargs",
")",
":",
"source",
",",
"target",
"=",
"dtype",
"(",
"source",
")",
",",
"dtype",
"(",
"target",
")",
"if",
"not",
"castable",
"(",
"source",
",",
"target",
",",
"*",
"*",
"kw... | [
1304,
0
] | [
1311,
17
] | python | en | ['en', 'en', 'en'] | True |
Interval.resolution | (self) | Unit's name | Unit's name | def resolution(self):
"""Unit's name"""
return self._units[self.unit] | [
"def",
"resolution",
"(",
"self",
")",
":",
"return",
"self",
".",
"_units",
"[",
"self",
".",
"unit",
"]"
] | [
420,
4
] | [
422,
37
] | python | en | ['en', 'sq', 'en'] | False |
Struct.__init__ | (self, names, types, nullable=True) | Construct a ``Struct`` type from a `names` and `types`.
Parameters
----------
names : Sequence[str]
Sequence of strings indicating the name of each field in the
struct.
types : Sequence[Union[str, DataType]]
Sequence of strings or :class:`~ibis.expr.d... | Construct a ``Struct`` type from a `names` and `types`. | def __init__(self, names, types, nullable=True):
"""Construct a ``Struct`` type from a `names` and `types`.
Parameters
----------
names : Sequence[str]
Sequence of strings indicating the name of each field in the
struct.
types : Sequence[Union[str, DataTy... | [
"def",
"__init__",
"(",
"self",
",",
"names",
",",
"types",
",",
"nullable",
"=",
"True",
")",
":",
"if",
"len",
"(",
"names",
")",
"!=",
"len",
"(",
"types",
")",
":",
"raise",
"ValueError",
"(",
"'names and types must have the same length'",
")",
"super"... | [
472,
4
] | [
490,
63
] | python | en | ['en', 'en', 'en'] | True |
TypeParser.type | (self) |
type : primitive
| decimal
| array
| set
| map
| struct
primitive : "any"
| "null"
| "bool"
| "boolean"
| "int8"
| "int16"
| "int... |
type : primitive
| decimal
| array
| set
| map
| struct | def type(self):
"""
type : primitive
| decimal
| array
| set
| map
| struct
primitive : "any"
| "null"
| "bool"
| "boolean"
| "int8"
| "int1... | [
"def",
"type",
"(",
"self",
")",
":",
"if",
"self",
".",
"_accept",
"(",
"Tokens",
".",
"PRIMITIVE",
")",
":",
"return",
"self",
".",
"tok",
".",
"value",
"elif",
"self",
".",
"_accept",
"(",
"Tokens",
".",
"TIMESTAMP",
")",
":",
"if",
"self",
".",... | [
880,
4
] | [
1039,
76
] | python | en | ['en', 'error', 'th'] | False |
privileges_granted_directly | (self, node=None) | Run checks with privileges granted directly.
| Run checks with privileges granted directly.
| def privileges_granted_directly(self, node=None):
"""Run checks with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=check_privilege,
examples=Examples("privilege gran... | [
"def",
"privileges_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"{user_... | [
10,
0
] | [
24,
74
] | python | en | ['en', 'en', 'en'] | True |
privileges_granted_via_role | (self, node=None) | Run checks with privileges granted through a role.
| Run checks with privileges granted through a role.
| def privileges_granted_via_role(self, node=None):
"""Run checks with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), role(node, f"{role_name}"):
wit... | [
"def",
"privileges_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with"... | [
27,
0
] | [
45,
74
] | python | en | ['en', 'en', 'en'] | True |
check_privilege | (self, privilege, grant_target_name, user_name, node=None) | Run checks for commands that require SYSTEM SHUTDOWN privilege.
| Run checks for commands that require SYSTEM SHUTDOWN privilege.
| def check_privilege(self, privilege, grant_target_name, user_name, node=None):
"""Run checks for commands that require SYSTEM SHUTDOWN privilege.
"""
if node is None:
node = self.context.node
Suite(test=shutdown)(privilege=privilege, grant_target_name=grant_target_name, user_name=user_name)
... | [
"def",
"check_privilege",
"(",
"self",
",",
"privilege",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"Suite",
"(",
"test",
"=",
"shut... | [
55,
0
] | [
63,
99
] | python | en | ['en', 'it', 'en'] | True |
shutdown | (self, privilege, grant_target_name, user_name, node=None) | Check that user is only able to execute `SYSTEM SHUTDOWN` when they have the necessary privilege.
| Check that user is only able to execute `SYSTEM SHUTDOWN` when they have the necessary privilege.
| def shutdown(self, privilege, grant_target_name, user_name, node=None):
"""Check that user is only able to execute `SYSTEM SHUTDOWN` when they have the necessary privilege.
"""
cluster = self.context.cluster
exitcode, message = errors.not_enough_privileges(name=user_name)
if node is None:
... | [
"def",
"shutdown",
"(",
"self",
",",
"privilege",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"cluster",
"=",
"self",
".",
"context",
".",
"cluster",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",... | [
66,
0
] | [
130,
51
] | python | en | ['en', 'en', 'en'] | True |
kill | (self, privilege, grant_target_name, user_name, node=None) | Check that user is only able to execute `SYSTEM KILL` when they have the necessary privilege.
| Check that user is only able to execute `SYSTEM KILL` when they have the necessary privilege.
| def kill(self, privilege, grant_target_name, user_name, node=None):
"""Check that user is only able to execute `SYSTEM KILL` when they have the necessary privilege.
"""
cluster = self.context.cluster
exitcode, message = errors.not_enough_privileges(name=user_name)
if node is None:
node = s... | [
"def",
"kill",
"(",
"self",
",",
"privilege",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"cluster",
"=",
"self",
".",
"context",
".",
"cluster",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"... | [
133,
0
] | [
199,
51
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1") | Check the RBAC functionality of SYSTEM SHUTDOWN.
| Check the RBAC functionality of SYSTEM SHUTDOWN.
| def feature(self, node="clickhouse1"):
"""Check the RBAC functionality of SYSTEM SHUTDOWN.
"""
self.context.node = self.context.cluster.node(node)
Suite(run=privileges_granted_directly, setup=instrument_clickhouse_server_log)
Suite(run=privileges_granted_via_role, setup=instrument_clickhouse_server... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
"Suite",
"(",
"run",
"=",
"privileges_granted_directly",
",",
... | [
208,
0
] | [
214,
82
] | python | en | ['en', 'en', 'en'] | True |
dict_setup | (node, table_name, dict_name, type="UInt64") | Setup and teardown of table and dictionary needed for the tests.
| Setup and teardown of table and dictionary needed for the tests.
| def dict_setup(node, table_name, dict_name, type="UInt64"):
"""Setup and teardown of table and dictionary needed for the tests.
"""
try:
with Given("I have a table"):
node.query(f"CREATE TABLE {table_name} (x UInt64, y UInt64, z {type}) ENGINE = Memory")
with And("I have a dict... | [
"def",
"dict_setup",
"(",
"node",
",",
"table_name",
",",
"dict_name",
",",
"type",
"=",
"\"UInt64\"",
")",
":",
"try",
":",
"with",
"Given",
"(",
"\"I have a table\"",
")",
":",
"node",
".",
"query",
"(",
"f\"CREATE TABLE {table_name} (x UInt64, y UInt64, z {type... | [
9,
0
] | [
27,
64
] | python | en | ['en', 'en', 'en'] | True |
dictGet_granted_directly | (self, node=None) | Run dictGet checks with privileges granted directly.
| Run dictGet checks with privileges granted directly.
| def dictGet_granted_directly(self, node=None):
"""Run dictGet checks with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=dictGet_check,
examples=Examples("privilege o... | [
"def",
"dictGet_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"{user_nam... | [
30,
0
] | [
44,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGet_granted_via_role | (self, node=None) | Run dictGet checks with privileges granted through a role.
| Run dictGet checks with privileges granted through a role.
| def dictGet_granted_via_role(self, node=None):
"""Run dictGet checks with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), role(node, f"{role_name}"):
... | [
"def",
"dictGet_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
... | [
47,
0
] | [
65,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGet_check | (self, privilege, on, grant_target_name, user_name, node=None) | Check that user is able to execute `dictGet` if and only if they have the necessary privileges.
| Check that user is able to execute `dictGet` if and only if they have the necessary privileges.
| def dictGet_check(self, privilege, on, grant_target_name, user_name, node=None):
"""Check that user is able to execute `dictGet` if and only if they have the necessary privileges.
"""
if node is None:
node = self.context.node
dict_name = f"dict_{getuid()}"
table_name = f"table_{getuid()}"
... | [
"def",
"dictGet_check",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"dict_name",
"=",
"f\"d... | [
78,
0
] | [
125,
145
] | python | en | ['en', 'en', 'en'] | True |
dictGetOrDefault_granted_directly | (self, node=None) | Run dictGetOrDefault checks with privileges granted directly.
| Run dictGetOrDefault checks with privileges granted directly.
| def dictGetOrDefault_granted_directly(self, node=None):
"""Run dictGetOrDefault checks with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=dictGetOrDefault_check,
exa... | [
"def",
"dictGetOrDefault_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"... | [
128,
0
] | [
142,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGetOrDefault_granted_via_role | (self, node=None) | Run dictGetOrDefault checks with privileges granted through a role.
| Run dictGetOrDefault checks with privileges granted through a role.
| def dictGetOrDefault_granted_via_role(self, node=None):
"""Run dictGetOrDefault checks with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), role(node, f"{rol... | [
"def",
"dictGetOrDefault_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
... | [
145,
0
] | [
163,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGetOrDefault_check | (self, privilege, on, grant_target_name, user_name, node=None) | Check that user is able to execute `dictGetOrDefault` if and only if they have the necessary privileges.
| Check that user is able to execute `dictGetOrDefault` if and only if they have the necessary privileges.
| def dictGetOrDefault_check(self, privilege, on, grant_target_name, user_name, node=None):
"""Check that user is able to execute `dictGetOrDefault` if and only if they have the necessary privileges.
"""
if node is None:
node = self.context.node
dict_name = f"dict_{getuid()}"
table_name = f"t... | [
"def",
"dictGetOrDefault_check",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"dict_name",
"="... | [
176,
0
] | [
223,
166
] | python | en | ['en', 'en', 'en'] | True |
dictHas_granted_directly | (self, node=None) | Run dictHas checks with privileges granted directly.
| Run dictHas checks with privileges granted directly.
| def dictHas_granted_directly(self, node=None):
"""Run dictHas checks with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=dictHas_check,
examples=Examples("privilege o... | [
"def",
"dictHas_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"{user_nam... | [
226,
0
] | [
240,
80
] | python | en | ['en', 'en', 'en'] | True |
dictHas_granted_via_role | (self, node=None) | Run checks with privileges granted through a role.
| Run checks with privileges granted through a role.
| def dictHas_granted_via_role(self, node=None):
"""Run checks with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), role(node, f"{role_name}"):
with W... | [
"def",
"dictHas_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
... | [
243,
0
] | [
261,
80
] | python | en | ['en', 'en', 'en'] | True |
dictHas_check | (self, privilege, on, grant_target_name, user_name, node=None) | Check that user is able to execute `dictHas` if and only if they have the necessary privileges.
| Check that user is able to execute `dictHas` if and only if they have the necessary privileges.
| def dictHas_check(self, privilege, on, grant_target_name, user_name, node=None):
"""Check that user is able to execute `dictHas` if and only if they have the necessary privileges.
"""
if node is None:
node = self.context.node
dict_name = f"dict_{getuid()}"
table_name = f"table_{getuid()}"
... | [
"def",
"dictHas_check",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"dict_name",
"=",
"f\"d... | [
274,
0
] | [
321,
140
] | python | en | ['en', 'en', 'en'] | True |
dictGetHierarchy_granted_directly | (self, node=None) | Run dictGetHierarchy checks with privileges granted directly.
| Run dictGetHierarchy checks with privileges granted directly.
| def dictGetHierarchy_granted_directly(self, node=None):
"""Run dictGetHierarchy checks with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=dictGetHierarchy_check,
exam... | [
"def",
"dictGetHierarchy_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"... | [
324,
0
] | [
337,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGetHierarchy_granted_via_role | (self, node=None) | Run checks with privileges granted through a role.
| Run checks with privileges granted through a role.
| def dictGetHierarchy_granted_via_role(self, node=None):
"""Run checks with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), role(node, f"{role_name}"):
... | [
"def",
"dictGetHierarchy_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
... | [
340,
0
] | [
358,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGetHierarchy_check | (self, privilege, on, grant_target_name, user_name, node=None) | Check that user is able to execute `dictGetHierarchy` if and only if they have the necessary privileges.
| Check that user is able to execute `dictGetHierarchy` if and only if they have the necessary privileges.
| def dictGetHierarchy_check(self, privilege, on, grant_target_name, user_name, node=None):
"""Check that user is able to execute `dictGetHierarchy` if and only if they have the necessary privileges.
"""
if node is None:
node = self.context.node
dict_name = f"dict_{getuid()}"
table_name = f"t... | [
"def",
"dictGetHierarchy_check",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"dict_name",
"="... | [
371,
0
] | [
418,
149
] | python | en | ['en', 'en', 'en'] | True |
dictIsIn_granted_directly | (self, node=None) | Run dictIsIn checks with privileges granted directly.
| Run dictIsIn checks with privileges granted directly.
| def dictIsIn_granted_directly(self, node=None):
"""Run dictIsIn checks with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=dictIsIn_check,
examples=Examples("privilege... | [
"def",
"dictIsIn_granted_directly",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
",",
"f\"{user_na... | [
421,
0
] | [
434,
80
] | python | en | ['en', 'en', 'en'] | True |
dictIsIn_granted_via_role | (self, node=None) | Run checks with privileges granted through a role.
| Run checks with privileges granted through a role.
| def dictIsIn_granted_via_role(self, node=None):
"""Run checks with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), role(node, f"{role_name}"):
with ... | [
"def",
"dictIsIn_granted_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
... | [
437,
0
] | [
455,
80
] | python | en | ['en', 'en', 'en'] | True |
dictIsIn_check | (self, privilege, on, grant_target_name, user_name, node=None) | Check that user is able to execute `dictIsIn` if and only if they have the necessary privileges.
| Check that user is able to execute `dictIsIn` if and only if they have the necessary privileges.
| def dictIsIn_check(self, privilege, on, grant_target_name, user_name, node=None):
"""Check that user is able to execute `dictIsIn` if and only if they have the necessary privileges.
"""
if node is None:
node = self.context.node
dict_name = f"dict_{getuid()}"
table_name = f"table_{getuid()}"... | [
"def",
"dictIsIn_check",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"dict_name",
"=",
"f\"... | [
468,
0
] | [
515,
153
] | python | en | ['en', 'en', 'en'] | True |
dictGetType_granted_directly | (self, type, node=None) | Run checks on dictGet with a type specified with privileges granted directly.
| Run checks on dictGet with a type specified with privileges granted directly.
| def dictGetType_granted_directly(self, type, node=None):
"""Run checks on dictGet with a type specified with privileges granted directly.
"""
user_name = f"user_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"):
Suite(run=dictGetType_check,
... | [
"def",
"dictGetType_granted_directly",
"(",
"self",
",",
"type",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"with",
"user",
"(",
"node",
... | [
534,
0
] | [
547,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGetType_granted_via_role | (self, type, node=None) | Run checks on dictGet with a type specified with privileges granted through a role.
| Run checks on dictGet with a type specified with privileges granted through a role.
| def dictGetType_granted_via_role(self, type, node=None):
"""Run checks on dictGet with a type specified with privileges granted through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = self.context.node
with user(node, f"{user_name}"), ... | [
"def",
"dictGetType_granted_via_role",
"(",
"self",
",",
"type",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
... | [
566,
0
] | [
584,
80
] | python | en | ['en', 'en', 'en'] | True |
dictGetType_check | (self, privilege, on, grant_target_name, user_name, type, node=None) | Check that user is able to execute `dictGet` if and only if they have the necessary privileges.
| Check that user is able to execute `dictGet` if and only if they have the necessary privileges.
| def dictGetType_check(self, privilege, on, grant_target_name, user_name, type, node=None):
"""Check that user is able to execute `dictGet` if and only if they have the necessary privileges.
"""
if node is None:
node = self.context.node
dict_name = f"dict_{getuid()}"
table_name = f"table_{ge... | [
"def",
"dictGetType_check",
"(",
"self",
",",
"privilege",
",",
"on",
",",
"grant_target_name",
",",
"user_name",
",",
"type",
",",
"node",
"=",
"None",
")",
":",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"dict_... | [
597,
0
] | [
644,
150
] | python | en | ['en', 'en', 'en'] | True |
feature | (self, node="clickhouse1", stress=None, parallel=None) | Check the RBAC functionality of dictGet.
| Check the RBAC functionality of dictGet.
| def feature(self, node="clickhouse1", stress=None, parallel=None):
"""Check the RBAC functionality of dictGet.
"""
self.context.node = self.context.cluster.node(node)
if parallel is not None:
self.context.parallel = parallel
if stress is not None:
self.context.stress = stress
w... | [
"def",
"feature",
"(",
"self",
",",
"node",
"=",
"\"clickhouse1\"",
",",
"stress",
"=",
"None",
",",
"parallel",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"node",
"=",
"self",
".",
"context",
".",
"cluster",
".",
"node",
"(",
"node",
")",
... | [
653,
0
] | [
686,
23
] | python | en | ['en', 'en', 'en'] | True |
create | (self, node=None) | Test the RBAC functionality of the `CREATE MATERIALIZED VIEW` command.
| Test the RBAC functionality of the `CREATE MATERIALIZED VIEW` command.
| def create(self, node=None):
"""Test the RBAC functionality of the `CREATE MATERIALIZED VIEW` command.
"""
Scenario(run=create_without_create_view_privilege, setup=instrument_clickhouse_server_log)
Scenario(run=create_with_create_view_privilege_granted_directly_or_via_role, setup=instrument_clickhouse_s... | [
"def",
"create",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"Scenario",
"(",
"run",
"=",
"create_without_create_view_privilege",
",",
"setup",
"=",
"instrument_clickhouse_server_log",
")",
"Scenario",
"(",
"run",
"=",
"create_with_create_view_privilege_granted_d... | [
29,
0
] | [
44,
130
] | python | en | ['en', 'en', 'en'] | True |
create_without_create_view_privilege | (self, node=None) | Check that user is unable to create a view without CREATE VIEW privilege.
| Check that user is unable to create a view without CREATE VIEW privilege.
| def create_without_create_view_privilege(self, node=None):
"""Check that user is unable to create a view without CREATE VIEW privilege.
"""
user_name = f"user_{getuid()}"
view_name = f"view_{getuid()}"
exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
if node is None:
... | [
"def",
"create_without_create_view_privilege",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"view_name",
"=",
"f\"view_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
... | [
47,
0
] | [
60,
51
] | python | en | ['en', 'en', 'en'] | True |
create_with_create_view_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view with CREATE VIEW privilege, either granted directly or through a role.
| Check that user is able to create a view with CREATE VIEW privilege, either granted directly or through a role.
| def create_with_create_view_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view with CREATE VIEW privilege, either granted directly or through a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node = s... | [
"def",
"create_with_create_view_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"... | [
63,
0
] | [
79,
126
] | python | en | ['en', 'en', 'en'] | True |
create_with_create_view_privilege | (self, grant_target_name, user_name, node=None) | Check that user is able to create a view with the granted privileges.
| Check that user is able to create a view with the granted privileges.
| def create_with_create_view_privilege(self, grant_target_name, user_name, node=None):
"""Check that user is able to create a view with the granted privileges.
"""
view_name = f"view_{getuid()}"
if node is None:
node = self.context.node
try:
with When("I grant the CREATE VIEW privile... | [
"def",
"create_with_create_view_privilege",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node"... | [
82,
0
] | [
99,
58
] | python | en | ['en', 'en', 'en'] | True |
create_with_revoked_create_view_privilege_revoked_directly_or_from_role | (self, node=None) | Check that user is unable to create view after the CREATE VIEW privilege is revoked, either directly or from a role.
| Check that user is unable to create view after the CREATE VIEW privilege is revoked, either directly or from a role.
| def create_with_revoked_create_view_privilege_revoked_directly_or_from_role(self, node=None):
"""Check that user is unable to create view after the CREATE VIEW privilege is revoked, either directly or from a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
... | [
"def",
"create_with_revoked_create_view_privilege_revoked_directly_or_from_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
... | [
102,
0
] | [
118,
123
] | python | en | ['en', 'en', 'en'] | True |
create_with_revoked_create_view_privilege | (self, grant_target_name, user_name, node=None) | Revoke CREATE VIEW privilege and check the user is unable to create a view.
| Revoke CREATE VIEW privilege and check the user is unable to create a view.
| def create_with_revoked_create_view_privilege(self, grant_target_name, user_name, node=None):
"""Revoke CREATE VIEW privilege and check the user is unable to create a view.
"""
view_name = f"view_{getuid()}"
exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
if node is None:
... | [
"def",
"create_with_revoked_create_view_privilege",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"... | [
121,
0
] | [
137,
47
] | python | en | ['en', 'en', 'en'] | True |
create_without_source_table_privilege | (self, node=None) | Check that user is unable to create a view without select
privilege on the source table.
| Check that user is unable to create a view without select
privilege on the source table.
| def create_without_source_table_privilege(self, node=None):
"""Check that user is unable to create a view without select
privilege on the source table.
"""
user_name = f"user_{getuid()}"
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
exitcode, message = errors.not_enough_pri... | [
"def",
"create_without_source_table_privilege",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
... | [
140,
0
] | [
158,
55
] | python | en | ['en', 'en', 'en'] | True |
create_with_source_table_privilege_granted_directly_or_via_role | (self, node=None) | Check that a user is able to create a view if and only if the user has create view privilege and
select privilege on the source table, either granted directly or through a role.
| Check that a user is able to create a view if and only if the user has create view privilege and
select privilege on the source table, either granted directly or through a role.
| def create_with_source_table_privilege_granted_directly_or_via_role(self, node=None):
"""Check that a user is able to create a view if and only if the user has create view privilege and
select privilege on the source table, either granted directly or through a role.
"""
user_name = f"user_{getuid()}"
... | [
"def",
"create_with_source_table_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
... | [
161,
0
] | [
178,
137
] | python | en | ['en', 'en', 'en'] | True |
create_with_source_table_privilege | (self, user_name, grant_target_name, node=None) | Check that user is unable to create a view without SELECT privilege on the source table.
| Check that user is unable to create a view without SELECT privilege on the source table.
| def create_with_source_table_privilege(self, user_name, grant_target_name, node=None):
"""Check that user is unable to create a view without SELECT privilege on the source table.
"""
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
if node is None:
node = self.context.node
... | [
"def",
"create_with_source_table_privilege",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
... | [
181,
0
] | [
207,
62
] | python | en | ['en', 'en', 'en'] | True |
create_with_subquery_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view where the stored query has two subqueries
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
| Check that user is able to create a view where the stored query has two subqueries
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
| def create_with_subquery_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view where the stored query has two subqueries
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
"""
user_name = f"user... | [
"def",
"create_with_subquery_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"con... | [
210,
0
] | [
228,
124
] | python | en | ['en', 'en', 'en'] | True |
create_with_subquery | (self, user_name, grant_target_name, node=None) | Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| def create_with_subquery(self, user_name, grant_target_name, node=None):
"""Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
table1_name = ... | [
"def",
"create_with_subquery",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"table2_name... | [
231,
0
] | [
270,
62
] | python | en | ['en', 'en', 'en'] | True |
create_with_join_query_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view where the stored query includes a `JOIN` statement
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
| Check that user is able to create a view where the stored query includes a `JOIN` statement
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
| def create_with_join_query_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view where the stored query includes a `JOIN` statement
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
"""
user_na... | [
"def",
"create_with_join_query_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"c... | [
273,
0
] | [
291,
126
] | python | en | ['en', 'en', 'en'] | True |
create_with_join_query | (self, grant_target_name, user_name, node=None) | Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| def create_with_join_query(self, grant_target_name, user_name, node=None):
"""Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
table1_name ... | [
"def",
"create_with_join_query",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"exitcode"... | [
294,
0
] | [
332,
62
] | python | en | ['en', 'en', 'en'] | True |
create_with_union_query_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view where the stored query includes a `UNION ALL` statement
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
| Check that user is able to create a view where the stored query includes a `UNION ALL` statement
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
| def create_with_union_query_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view where the stored query includes a `UNION ALL` statement
if and only if the user has SELECT privilege on all of the tables,
either granted directly or through a role.
"""
u... | [
"def",
"create_with_union_query_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"... | [
335,
0
] | [
353,
127
] | python | en | ['en', 'en', 'en'] | True |
create_with_union_query | (self, grant_target_name, user_name, node=None) | Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| def create_with_union_query(self, grant_target_name, user_name, node=None):
"""Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
table1_name... | [
"def",
"create_with_union_query",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"exitcode... | [
356,
0
] | [
394,
62
] | python | en | ['en', 'en', 'en'] | True |
create_with_join_union_subquery_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view with a stored query that includes `UNION ALL`, `JOIN` and two subqueries
if and only if the user has SELECT privilege on all of the tables, either granted directly or through a role.
| Check that user is able to create a view with a stored query that includes `UNION ALL`, `JOIN` and two subqueries
if and only if the user has SELECT privilege on all of the tables, either granted directly or through a role.
| def create_with_join_union_subquery_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view with a stored query that includes `UNION ALL`, `JOIN` and two subqueries
if and only if the user has SELECT privilege on all of the tables, either granted directly or through ... | [
"def",
"create_with_join_union_subquery_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
... | [
397,
0
] | [
414,
135
] | python | en | ['en', 'en', 'en'] | True |
create_with_join_union_subquery | (self, grant_target_name, user_name, node=None) | Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| def create_with_join_union_subquery(self, grant_target_name, user_name, node=None):
"""Grant select and create view privileges and check that user is able to create a view
if and only if they have all necessary privileges.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
tab... | [
"def",
"create_with_join_union_subquery",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"... | [
417,
0
] | [
460,
66
] | python | en | ['en', 'en', 'en'] | True |
create_with_nested_views_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view with a stored query that includes other views if and only if
they have SELECT privilege on all the views and the source tables for those views.
| Check that user is able to create a view with a stored query that includes other views if and only if
they have SELECT privilege on all the views and the source tables for those views.
| def create_with_nested_views_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view with a stored query that includes other views if and only if
they have SELECT privilege on all the views and the source tables for those views.
"""
user_name = f"user_{getuid... | [
"def",
"create_with_nested_views_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
... | [
464,
0
] | [
481,
128
] | python | en | ['en', 'en', 'en'] | True |
create_with_nested_views | (self, grant_target_name, user_name, node=None) | Grant SELECT and CREATE VIEW privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| Grant SELECT and CREATE VIEW privileges and check that user is able to create a view
if and only if they have all necessary privileges.
| def create_with_nested_views(self, grant_target_name, user_name, node=None):
"""Grant SELECT and CREATE VIEW privileges and check that user is able to create a view
if and only if they have all necessary privileges.
"""
view0_name = f"view0_{getuid()}"
view1_name = f"view1_{getuid()}"
view2_name... | [
"def",
"create_with_nested_views",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view0_name",
"=",
"f\"view0_{getuid()}\"",
"view1_name",
"=",
"f\"view1_{getuid()}\"",
"view2_name",
"=",
"f\"view2_{getuid()}\"",
"view3_nam... | [
484,
0
] | [
540,
67
] | python | en | ['en', 'en', 'en'] | True |
create_with_target_table_privilege_directly_or_via_role | (self, node=None) | Check that user is able to create a materialized view with a target table if and only if
the user has CREATE VIEW privilege and SELECT and INSERT privileges on the target table.
| Check that user is able to create a materialized view with a target table if and only if
the user has CREATE VIEW privilege and SELECT and INSERT privileges on the target table.
| def create_with_target_table_privilege_directly_or_via_role(self, node=None):
"""Check that user is able to create a materialized view with a target table if and only if
the user has CREATE VIEW privilege and SELECT and INSERT privileges on the target table.
"""
user_name = f"user_{getuid()}"
role_n... | [
"def",
"create_with_target_table_privilege_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context... | [
543,
0
] | [
560,
128
] | python | en | ['en', 'en', 'en'] | True |
create_with_target_table | (self, grant_target_name, user_name, node=None) | Check that user is unable to create a view without INSERT and SELECT privileges and is able to once both are granted.
| Check that user is unable to create a view without INSERT and SELECT privileges and is able to once both are granted.
| def create_with_target_table(self, grant_target_name, user_name, node=None):
"""Check that user is unable to create a view without INSERT and SELECT privileges and is able to once both are granted.
"""
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
exitcode, message = errors.not_eno... | [
"def",
"create_with_target_table",
"(",
"self",
",",
"grant_target_name",
",",
"user_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
".",
"n... | [
563,
0
] | [
602,
62
] | python | en | ['en', 'en', 'en'] | True |
create_with_populate_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view with POPULATE specified if and only if
they have CREATE VIEW and INSERT privileges for the view, either directly or from a role.
| Check that user is able to create a view with POPULATE specified if and only if
they have CREATE VIEW and INSERT privileges for the view, either directly or from a role.
| def create_with_populate_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view with POPULATE specified if and only if
they have CREATE VIEW and INSERT privileges for the view, either directly or from a role.
"""
user_name = f"user_{getuid()}"
role_name ... | [
"def",
"create_with_populate_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"con... | [
605,
0
] | [
626,
123
] | python | en | ['en', 'en', 'en'] | True |
create_with_populate | (self, user_name, grant_target_name, node=None) | Check that user is only able to create the view after INSERT privilege is granted.
| Check that user is only able to create the view after INSERT privilege is granted.
| def create_with_populate(self, user_name, grant_target_name, node=None):
"""Check that user is only able to create the view after INSERT privilege is granted.
"""
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
... | [
"def",
"create_with_populate",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_e... | [
629,
0
] | [
660,
58
] | python | en | ['en', 'en', 'en'] | True |
create_with_populate_source_table_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to create a view with POPULATE and a source table specified if and only if
they have CREATE VIEW and INSERT privileges for the view, either directly or from a role.
| Check that user is able to create a view with POPULATE and a source table specified if and only if
they have CREATE VIEW and INSERT privileges for the view, either directly or from a role.
| def create_with_populate_source_table_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to create a view with POPULATE and a source table specified if and only if
they have CREATE VIEW and INSERT privileges for the view, either directly or from a role.
"""
user_name = f... | [
"def",
"create_with_populate_source_table_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
... | [
663,
0
] | [
680,
141
] | python | en | ['en', 'en', 'en'] | True |
create_with_populate_source_table | (self, user_name, grant_target_name, node=None) | Check that user is only able to create the view after INSERT privilege is granted.
| Check that user is only able to create the view after INSERT privilege is granted.
| def create_with_populate_source_table(self, user_name, grant_target_name, node=None):
"""Check that user is only able to create the view after INSERT privilege is granted.
"""
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
exitcode, message = errors.not_enough_privileges(name=f"{use... | [
"def",
"create_with_populate_source_table",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
... | [
683,
0
] | [
716,
62
] | python | en | ['en', 'en', 'en'] | True |
select | (self, node=None) | Test the RBAC functionality of the `SELECT FROM materialized view` command
| Test the RBAC functionality of the `SELECT FROM materialized view` command
| def select(self, node=None):
"""Test the RBAC functionality of the `SELECT FROM materialized view` command
"""
Scenario(run=select_without_select_privilege, setup=instrument_clickhouse_server_log)
Scenario(run=select_with_select_privilege_granted_directly_or_via_role, setup=instrument_clickhouse_server_... | [
"def",
"select",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"Scenario",
"(",
"run",
"=",
"select_without_select_privilege",
",",
"setup",
"=",
"instrument_clickhouse_server_log",
")",
"Scenario",
"(",
"run",
"=",
"select_with_select_privilege_granted_directly_or... | [
722,
0
] | [
735,
139
] | python | en | ['en', 'en', 'en'] | True |
select_without_select_privilege | (self, node=None) | Check that user is unable to select on a view without view SELECT privilege.
| Check that user is unable to select on a view without view SELECT privilege.
| def select_without_select_privilege(self, node=None):
"""Check that user is unable to select on a view without view SELECT privilege.
"""
user_name = f"user_{getuid()}"
view_name = f"view_{getuid()}"
exitcode, message = errors.not_enough_privileges(name=f"{user_name}")
if node is None:
... | [
"def",
"select_without_select_privilege",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"view_name",
"=",
"f\"view_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
".",
"not_enough_privileges",
"(",
"name",
"=",
... | [
738,
0
] | [
759,
62
] | python | en | ['en', 'en', 'en'] | True |
select_with_select_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to select from a view if and only if they have select privilege on that view, either directly or from a role.
| Check that user is able to select from a view if and only if they have select privilege on that view, either directly or from a role.
| def select_with_select_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to select from a view if and only if they have select privilege on that view, either directly or from a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:... | [
"def",
"select_with_select_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"conte... | [
762,
0
] | [
778,
121
] | python | en | ['en', 'en', 'en'] | True |
select_with_select_privilege | (self, user_name, grant_target_name, node=None) | Grant SELECT privilege on a view and check the user is able to SELECT from it.
| Grant SELECT privilege on a view and check the user is able to SELECT from it.
| def select_with_select_privilege(self, user_name, grant_target_name, node=None):
"""Grant SELECT privilege on a view and check the user is able to SELECT from it.
"""
view_name = f"view_{getuid()}"
if node is None:
node = self.context.node
try:
with When("I have a view"):
... | [
"def",
"select_with_select_privilege",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"node",
"... | [
781,
0
] | [
802,
58
] | python | en | ['en', 'en', 'en'] | True |
select_with_select_privilege_revoked_directly_or_from_role | (self, node=None) | Check that user is unable to select from a view if their SELECT privilege is revoked, either directly or from a role.
| Check that user is unable to select from a view if their SELECT privilege is revoked, either directly or from a role.
| def select_with_select_privilege_revoked_directly_or_from_role(self, node=None):
"""Check that user is unable to select from a view if their SELECT privilege is revoked, either directly or from a role.
"""
user_name = f"user_{getuid()}"
role_name = f"role_{getuid()}"
if node is None:
node =... | [
"def",
"select_with_select_privilege_revoked_directly_or_from_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"cont... | [
805,
0
] | [
821,
118
] | python | en | ['en', 'en', 'en'] | True |
select_with_revoked_select_privilege | (self, user_name, grant_target_name, node=None) | Grant and revoke SELECT privilege on a view and check the user is unable to SELECT from it.
| Grant and revoke SELECT privilege on a view and check the user is unable to SELECT from it.
| def select_with_revoked_select_privilege(self, user_name, grant_target_name, node=None):
"""Grant and revoke SELECT privilege on a view and check the user is unable to SELECT from it.
"""
view_name = f"view_{getuid()}"
if node is None:
node = self.context.node
try:
with When("I have... | [
"def",
"select_with_revoked_select_privilege",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"context",
".",
"no... | [
824,
0
] | [
847,
58
] | python | en | ['en', 'en', 'en'] | True |
select_without_source_table_privilege | (self, node=None) | Check that user is unable to select from a view without SELECT privilege for the source table.
| Check that user is unable to select from a view without SELECT privilege for the source table.
| def select_without_source_table_privilege(self, node=None):
"""Check that user is unable to select from a view without SELECT privilege for the source table.
"""
user_name = f"user_{getuid()}"
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
exitcode, message = errors.not_enough_p... | [
"def",
"select_without_source_table_privilege",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"exitcode",
",",
"message",
"=",
"errors",
... | [
850,
0
] | [
875,
66
] | python | en | ['en', 'en', 'en'] | True |
select_with_source_table_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to select from a view, with source table in the stored query, if and only if
the user has SELECT privilege for the view and the source table, either directly or from a role.
| Check that user is able to select from a view, with source table in the stored query, if and only if
the user has SELECT privilege for the view and the source table, either directly or from a role.
| def select_with_source_table_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to select from a view, with source table in the stored query, if and only if
the user has SELECT privilege for the view and the source table, either directly or from a role.
"""
user_name = f... | [
"def",
"select_with_source_table_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
... | [
878,
0
] | [
895,
128
] | python | en | ['en', 'en', 'en'] | True |
select_with_source_table_privilege | (self, user_name, grant_target_name, node=None) | Grant SELECT privilege on view and the source table for that view and check the user is able to SELECT from the view.
| Grant SELECT privilege on view and the source table for that view and check the user is able to SELECT from the view.
| def select_with_source_table_privilege(self, user_name, grant_target_name, node=None):
"""Grant SELECT privilege on view and the source table for that view and check the user is able to SELECT from the view.
"""
view_name = f"view_{getuid()}"
table_name = f"table_{getuid()}"
if node is None:
... | [
"def",
"select_with_source_table_privilege",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table_name",
"=",
"f\"table_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
... | [
898,
0
] | [
922,
62
] | python | en | ['en', 'en', 'en'] | True |
select_with_subquery_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to select from a view where the stored query has two subqueries if and only if
the user has SELECT privilege for that view and all tables, either directly or through a role.
| Check that user is able to select from a view where the stored query has two subqueries if and only if
the user has SELECT privilege for that view and all tables, either directly or through a role.
| def select_with_subquery_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to select from a view where the stored query has two subqueries if and only if
the user has SELECT privilege for that view and all tables, either directly or through a role.
"""
user_name = f"use... | [
"def",
"select_with_subquery_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"con... | [
925,
0
] | [
942,
124
] | python | en | ['en', 'en', 'en'] | True |
select_with_subquery | (self, user_name, grant_target_name, node=None) | Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
| Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
| def select_with_subquery(self, user_name, grant_target_name, node=None):
"""Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
tab... | [
"def",
"select_with_subquery",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"table2_name... | [
945,
0
] | [
982,
62
] | python | en | ['en', 'en', 'en'] | True |
select_with_join_query_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to select from a view where the stored query includes a `JOIN` statement if and only if
the user has SELECT privilege on all the tables and the view, either directly or through a role.
| Check that user is able to select from a view where the stored query includes a `JOIN` statement if and only if
the user has SELECT privilege on all the tables and the view, either directly or through a role.
| def select_with_join_query_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to select from a view where the stored query includes a `JOIN` statement if and only if
the user has SELECT privilege on all the tables and the view, either directly or through a role.
"""
user... | [
"def",
"select_with_join_query_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"c... | [
985,
0
] | [
1002,
120
] | python | en | ['en', 'en', 'en'] | True |
select_with_join_query | (self, user_name, grant_target_name, node=None) | Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
| Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
| def select_with_join_query(self, user_name, grant_target_name, node=None):
"""Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
t... | [
"def",
"select_with_join_query",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"exitcode"... | [
1005,
0
] | [
1040,
62
] | python | en | ['en', 'en', 'en'] | True |
select_with_union_query_privilege_granted_directly_or_via_role | (self, node=None) | Check that user is able to select from a view where the stored query includes a `UNION ALL` statement if and only if
the user has SELECT privilege on all the tables and the view, either directly or through a role.
| Check that user is able to select from a view where the stored query includes a `UNION ALL` statement if and only if
the user has SELECT privilege on all the tables and the view, either directly or through a role.
| def select_with_union_query_privilege_granted_directly_or_via_role(self, node=None):
"""Check that user is able to select from a view where the stored query includes a `UNION ALL` statement if and only if
the user has SELECT privilege on all the tables and the view, either directly or through a role.
"""
... | [
"def",
"select_with_union_query_privilege_granted_directly_or_via_role",
"(",
"self",
",",
"node",
"=",
"None",
")",
":",
"user_name",
"=",
"f\"user_{getuid()}\"",
"role_name",
"=",
"f\"role_{getuid()}\"",
"if",
"node",
"is",
"None",
":",
"node",
"=",
"self",
".",
"... | [
1043,
0
] | [
1060,
121
] | python | en | ['en', 'en', 'en'] | True |
select_with_union_query | (self, user_name, grant_target_name, node=None) | Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
| Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
| def select_with_union_query(self, user_name, grant_target_name, node=None):
"""Grant SELECT on the view and tables in the stored query and check the user is able to SELECT if and only if they have SELECT privilege on all of them.
"""
view_name = f"view_{getuid()}"
table0_name = f"table0_{getuid()}"
... | [
"def",
"select_with_union_query",
"(",
"self",
",",
"user_name",
",",
"grant_target_name",
",",
"node",
"=",
"None",
")",
":",
"view_name",
"=",
"f\"view_{getuid()}\"",
"table0_name",
"=",
"f\"table0_{getuid()}\"",
"table1_name",
"=",
"f\"table1_{getuid()}\"",
"exitcode... | [
1063,
0
] | [
1098,
62
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.