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
timestamp
(value)
Returns a timestamp literal if value is likely coercible to a timestamp Parameters ---------- value : timestamp value as string Returns -------- result : TimestampScalar
Returns a timestamp literal if value is likely coercible to a timestamp
def timestamp(value): """ Returns a timestamp literal if value is likely coercible to a timestamp Parameters ---------- value : timestamp value as string Returns -------- result : TimestampScalar """ if isinstance(value, six.string_types): try: value = pd.Ti...
[ "def", "timestamp", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ":", "try", ":", "value", "=", "pd", ".", "Timestamp", "(", "value", ")", "except", "pd", ".", "errors", ".", "OutOfBoundsDatetime", ":"...
[ 190, 0 ]
[ 213, 44 ]
python
en
['en', 'error', 'th']
False
date
(value)
Returns a date literal if value is likely coercible to a date Parameters ---------- value : date value as string Returns -------- result : TimeScalar
Returns a date literal if value is likely coercible to a date
def date(value): """ Returns a date literal if value is likely coercible to a date Parameters ---------- value : date value as string Returns -------- result : TimeScalar """ if isinstance(value, six.string_types): value = to_date(value) return literal(value, type=d...
[ "def", "date", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ":", "value", "=", "to_date", "(", "value", ")", "return", "literal", "(", "value", ",", "type", "=", "dt", ".", "date", ")" ]
[ 216, 0 ]
[ 230, 39 ]
python
en
['en', 'error', 'th']
False
time
(value)
Returns a time literal if value is likely coercible to a time Parameters ---------- value : time value as string Returns -------- result : TimeScalar
Returns a time literal if value is likely coercible to a time
def time(value): """ Returns a time literal if value is likely coercible to a time Parameters ---------- value : time value as string Returns -------- result : TimeScalar """ if isinstance(value, six.string_types): value = to_time(value) return literal(value, type=d...
[ "def", "time", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ":", "value", "=", "to_time", "(", "value", ")", "return", "literal", "(", "value", ",", "type", "=", "dt", ".", "time", ")" ]
[ 233, 0 ]
[ 247, 39 ]
python
en
['en', 'error', 'th']
False
interval
(value=None, unit='s', years=None, quarters=None, months=None, weeks=None, days=None, hours=None, minutes=None, seconds=None, milliseconds=None, microseconds=None, nanoseconds=None)
Returns an interval literal Parameters ---------- value : int or datetime.timedelta, default None years : int, default None quarters : int, default None months : int, default None days : int, default None weeks : int, default None hours : int, default None minutes : int, de...
Returns an interval literal
def interval(value=None, unit='s', years=None, quarters=None, months=None, weeks=None, days=None, hours=None, minutes=None, seconds=None, milliseconds=None, microseconds=None, nanoseconds=None): """ Returns an interval literal Parameters ---------- value : int or datetime....
[ "def", "interval", "(", "value", "=", "None", ",", "unit", "=", "'s'", ",", "years", "=", "None", ",", "quarters", "=", "None", ",", "months", "=", "None", ",", "weeks", "=", "None", ",", "days", "=", "None", ",", "hours", "=", "None", ",", "minu...
[ 250, 0 ]
[ 305, 51 ]
python
en
['en', 'error', 'th']
False
case
()
Similar to the .case method on array expressions, create a case builder that accepts self-contained boolean expressions (as opposed to expressions which are to be equality-compared with a fixed value expression) Use the .when method on the resulting object followed by .end to create a complete cas...
Similar to the .case method on array expressions, create a case builder that accepts self-contained boolean expressions (as opposed to expressions which are to be equality-compared with a fixed value expression)
def case(): """ Similar to the .case method on array expressions, create a case builder that accepts self-contained boolean expressions (as opposed to expressions which are to be equality-compared with a fixed value expression) Use the .when method on the resulting object followed by .end to create...
[ "def", "case", "(", ")", ":", "return", "ops", ".", "SearchedCaseBuilder", "(", ")" ]
[ 366, 0 ]
[ 390, 36 ]
python
en
['en', 'error', 'th']
False
now
()
Compute the current timestamp Returns ------- now : Timestamp scalar
Compute the current timestamp
def now(): """ Compute the current timestamp Returns ------- now : Timestamp scalar """ return ops.TimestampNow().to_expr()
[ "def", "now", "(", ")", ":", "return", "ops", ".", "TimestampNow", "(", ")", ".", "to_expr", "(", ")" ]
[ 393, 0 ]
[ 401, 39 ]
python
en
['en', 'error', 'th']
False
row_number
()
Analytic function for the current row number, starting at 0. This function does not require an ORDER BY clause, however, without an ORDER BY clause the order of the result is nondeterministic. Returns ------- row_number : IntArray
Analytic function for the current row number, starting at 0.
def row_number(): """Analytic function for the current row number, starting at 0. This function does not require an ORDER BY clause, however, without an ORDER BY clause the order of the result is nondeterministic. Returns ------- row_number : IntArray """ return ops.RowNumber().to_expr...
[ "def", "row_number", "(", ")", ":", "return", "ops", ".", "RowNumber", "(", ")", ".", "to_expr", "(", ")" ]
[ 404, 0 ]
[ 414, 36 ]
python
en
['en', 'en', 'en']
True
negate
(arg)
Negate a numeric expression Parameters ---------- arg : numeric value expression Returns ------- negated : type of caller
Negate a numeric expression
def negate(arg): """ Negate a numeric expression Parameters ---------- arg : numeric value expression Returns ------- negated : type of caller """ op = arg.op() if hasattr(op, 'negate'): result = op.negate() else: result = ops.Negate(arg) return res...
[ "def", "negate", "(", "arg", ")", ":", "op", "=", "arg", ".", "op", "(", ")", "if", "hasattr", "(", "op", ",", "'negate'", ")", ":", "result", "=", "op", ".", "negate", "(", ")", "else", ":", "result", "=", "ops", ".", "Negate", "(", "arg", "...
[ 438, 0 ]
[ 456, 27 ]
python
en
['en', 'error', 'th']
False
count
(expr, where=None)
Compute cardinality / sequence size of expression. For array expressions, the count is excluding nulls. For tables, it's the size of the entire table. Returns ------- counts : int64 type
Compute cardinality / sequence size of expression. For array expressions, the count is excluding nulls. For tables, it's the size of the entire table.
def count(expr, where=None): """ Compute cardinality / sequence size of expression. For array expressions, the count is excluding nulls. For tables, it's the size of the entire table. Returns ------- counts : int64 type """ op = expr.op() if isinstance(op, ops.DistinctColumn): ...
[ "def", "count", "(", "expr", ",", "where", "=", "None", ")", ":", "op", "=", "expr", ".", "op", "(", ")", "if", "isinstance", "(", "op", ",", "ops", ".", "DistinctColumn", ")", ":", "result", "=", "ops", ".", "CountDistinct", "(", "op", ".", "arg...
[ 459, 0 ]
[ 475, 31 ]
python
en
['en', 'error', 'th']
False
group_concat
(arg, sep=',', where=None)
Concatenate values using the indicated separator (comma by default) to produce a string Parameters ---------- arg : array expression sep : string, default ',' where : bool, default None Returns ------- concatenated : string scalar
Concatenate values using the indicated separator (comma by default) to produce a string
def group_concat(arg, sep=',', where=None): """ Concatenate values using the indicated separator (comma by default) to produce a string Parameters ---------- arg : array expression sep : string, default ',' where : bool, default None Returns ------- concatenated : string sc...
[ "def", "group_concat", "(", "arg", ",", "sep", "=", "','", ",", "where", "=", "None", ")", ":", "return", "ops", ".", "GroupConcat", "(", "arg", ",", "sep", ",", "where", ")", ".", "to_expr", "(", ")" ]
[ 478, 0 ]
[ 493, 53 ]
python
en
['en', 'error', 'th']
False
arbitrary
(arg, where=None, how='first')
Selects the first / last non-null value in a column Parameters ---------- arg : array expression where: bool, default None how : {'first', 'last', 'heavy'}, default 'first' Heavy selects a frequently occurring value using the heavy hitters algorithm. Heavy is only supported by Clic...
Selects the first / last non-null value in a column
def arbitrary(arg, where=None, how='first'): """ Selects the first / last non-null value in a column Parameters ---------- arg : array expression where: bool, default None how : {'first', 'last', 'heavy'}, default 'first' Heavy selects a frequently occurring value using the heavy hitt...
[ "def", "arbitrary", "(", "arg", ",", "where", "=", "None", ",", "how", "=", "'first'", ")", ":", "return", "ops", ".", "Arbitrary", "(", "arg", ",", "how", ",", "where", ")", ".", "to_expr", "(", ")" ]
[ 496, 0 ]
[ 512, 51 ]
python
en
['en', 'error', 'th']
False
typeof
(arg)
Return the data type of the argument according to the current backend Returns ------- typeof_arg : string
Return the data type of the argument according to the current backend
def typeof(arg): """ Return the data type of the argument according to the current backend Returns ------- typeof_arg : string """ return ops.TypeOf(arg).to_expr()
[ "def", "typeof", "(", "arg", ")", ":", "return", "ops", ".", "TypeOf", "(", "arg", ")", ".", "to_expr", "(", ")" ]
[ 631, 0 ]
[ 639, 36 ]
python
en
['en', 'error', 'th']
False
hash
(arg, how='fnv')
Compute an integer hash value for the indicated value expression. Parameters ---------- arg : value expression how : {'fnv'}, default 'fnv' Hash algorithm to use Returns ------- hash_value : int64 expression
Compute an integer hash value for the indicated value expression.
def hash(arg, how='fnv'): """ Compute an integer hash value for the indicated value expression. Parameters ---------- arg : value expression how : {'fnv'}, default 'fnv' Hash algorithm to use Returns ------- hash_value : int64 expression """ return ops.Hash(arg, how)....
[ "def", "hash", "(", "arg", ",", "how", "=", "'fnv'", ")", ":", "return", "ops", ".", "Hash", "(", "arg", ",", "how", ")", ".", "to_expr", "(", ")" ]
[ 642, 0 ]
[ 656, 39 ]
python
en
['en', 'error', 'th']
False
fillna
(arg, fill_value)
Replace any null values with the indicated fill value Parameters ---------- fill_value : scalar / array value or expression Examples -------- >>> import ibis >>> table = ibis.table([('col', 'int64'), ('other_col', 'int64')]) >>> result = table.col.fillna(5) >>> result2 = table...
Replace any null values with the indicated fill value
def fillna(arg, fill_value): """ Replace any null values with the indicated fill value Parameters ---------- fill_value : scalar / array value or expression Examples -------- >>> import ibis >>> table = ibis.table([('col', 'int64'), ('other_col', 'int64')]) >>> result = table.c...
[ "def", "fillna", "(", "arg", ",", "fill_value", ")", ":", "return", "ops", ".", "IfNull", "(", "arg", ",", "fill_value", ")", ".", "to_expr", "(", ")" ]
[ 659, 0 ]
[ 678, 48 ]
python
en
['en', 'error', 'th']
False
coalesce
(*args)
Compute the first non-null value(s) from the passed arguments in left-to-right order. This is also known as "combine_first" in pandas. Parameters ---------- *args : variable-length value list Examples -------- >>> import ibis >>> expr1 = None >>> expr2 = 4 >>> result = ibi...
Compute the first non-null value(s) from the passed arguments in left-to-right order. This is also known as "combine_first" in pandas.
def coalesce(*args): """ Compute the first non-null value(s) from the passed arguments in left-to-right order. This is also known as "combine_first" in pandas. Parameters ---------- *args : variable-length value list Examples -------- >>> import ibis >>> expr1 = None >>> ex...
[ "def", "coalesce", "(", "*", "args", ")", ":", "return", "ops", ".", "Coalesce", "(", "args", ")", ".", "to_expr", "(", ")" ]
[ 681, 0 ]
[ 701, 39 ]
python
en
['en', 'error', 'th']
False
greatest
(*args)
Compute the largest value (row-wise, if any arrays are present) among the supplied arguments. Returns ------- greatest : type depending on arguments
Compute the largest value (row-wise, if any arrays are present) among the supplied arguments.
def greatest(*args): """ Compute the largest value (row-wise, if any arrays are present) among the supplied arguments. Returns ------- greatest : type depending on arguments """ return ops.Greatest(args).to_expr()
[ "def", "greatest", "(", "*", "args", ")", ":", "return", "ops", ".", "Greatest", "(", "args", ")", ".", "to_expr", "(", ")" ]
[ 704, 0 ]
[ 713, 39 ]
python
en
['en', 'error', 'th']
False
least
(*args)
Compute the smallest value (row-wise, if any arrays are present) among the supplied arguments. Returns ------- least : type depending on arguments
Compute the smallest value (row-wise, if any arrays are present) among the supplied arguments.
def least(*args): """ Compute the smallest value (row-wise, if any arrays are present) among the supplied arguments. Returns ------- least : type depending on arguments """ return ops.Least(args).to_expr()
[ "def", "least", "(", "*", "args", ")", ":", "return", "ops", ".", "Least", "(", "args", ")", ".", "to_expr", "(", ")" ]
[ 716, 0 ]
[ 725, 36 ]
python
en
['en', 'error', 'th']
False
where
(boolean_expr, true_expr, false_null_expr)
Equivalent to the ternary expression: if X then Y else Z Parameters ---------- boolean_expr : BooleanValue (array or scalar) true_expr : value Values for each True value false_null_expr : value Values for False or NULL values Returns ------- result : arity depending on...
Equivalent to the ternary expression: if X then Y else Z
def where(boolean_expr, true_expr, false_null_expr): """ Equivalent to the ternary expression: if X then Y else Z Parameters ---------- boolean_expr : BooleanValue (array or scalar) true_expr : value Values for each True value false_null_expr : value Values for False or NULL val...
[ "def", "where", "(", "boolean_expr", ",", "true_expr", ",", "false_null_expr", ")", ":", "op", "=", "ops", ".", "Where", "(", "boolean_expr", ",", "true_expr", ",", "false_null_expr", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 728, 0 ]
[ 746, 23 ]
python
en
['en', 'error', 'th']
False
over
(expr, window)
Turn an aggregation or full-sample analytic operation into a windowed operation. See ibis.window for more details on window configuration Parameters ---------- expr : value expression window : ibis.Window Returns ------- expr : type of input
Turn an aggregation or full-sample analytic operation into a windowed operation. See ibis.window for more details on window configuration
def over(expr, window): """ Turn an aggregation or full-sample analytic operation into a windowed operation. See ibis.window for more details on window configuration Parameters ---------- expr : value expression window : ibis.Window Returns ------- expr : type of input """ ...
[ "def", "over", "(", "expr", ",", "window", ")", ":", "prior_op", "=", "expr", ".", "op", "(", ")", "if", "isinstance", "(", "prior_op", ",", "ops", ".", "WindowOp", ")", ":", "op", "=", "prior_op", ".", "over", "(", "window", ")", "else", ":", "o...
[ 749, 0 ]
[ 779, 17 ]
python
en
['en', 'error', 'th']
False
value_counts
(arg, metric_name='count')
Compute a frequency table for this value expression Parameters ---------- Returns ------- counts : TableExpr Aggregated table
Compute a frequency table for this value expression
def value_counts(arg, metric_name='count'): """ Compute a frequency table for this value expression Parameters ---------- Returns ------- counts : TableExpr Aggregated table """ base = ir.find_base_table(arg) metric = base.count().name(metric_name) try: arg.g...
[ "def", "value_counts", "(", "arg", ",", "metric_name", "=", "'count'", ")", ":", "base", "=", "ir", ".", "find_base_table", "(", "arg", ")", "metric", "=", "base", ".", "count", "(", ")", ".", "name", "(", "metric_name", ")", "try", ":", "arg", ".", ...
[ 782, 0 ]
[ 802, 47 ]
python
en
['en', 'error', 'th']
False
nullif
(value, null_if_expr)
Set values to null if they match/equal a particular expression (scalar or array-valued). Common use to avoid divide-by-zero problems (get NULL instead of INF on divide-by-zero): 5 / expr.nullif(0) Parameters ---------- value : value expression Value to modify null_if_expr : valu...
Set values to null if they match/equal a particular expression (scalar or array-valued).
def nullif(value, null_if_expr): """ Set values to null if they match/equal a particular expression (scalar or array-valued). Common use to avoid divide-by-zero problems (get NULL instead of INF on divide-by-zero): 5 / expr.nullif(0) Parameters ---------- value : value expression ...
[ "def", "nullif", "(", "value", ",", "null_if_expr", ")", ":", "return", "ops", ".", "NullIf", "(", "value", ",", "null_if_expr", ")", ".", "to_expr", "(", ")" ]
[ 805, 0 ]
[ 823, 52 ]
python
en
['en', 'error', 'th']
False
between
(arg, lower, upper)
Check if the input expr falls between the lower/upper bounds passed. Bounds are inclusive. All arguments must be comparable. Returns ------- is_between : BooleanValue
Check if the input expr falls between the lower/upper bounds passed. Bounds are inclusive. All arguments must be comparable.
def between(arg, lower, upper): """ Check if the input expr falls between the lower/upper bounds passed. Bounds are inclusive. All arguments must be comparable. Returns ------- is_between : BooleanValue """ lower = as_value_expr(lower) upper = as_value_expr(upper) op = ops.Betw...
[ "def", "between", "(", "arg", ",", "lower", ",", "upper", ")", ":", "lower", "=", "as_value_expr", "(", "lower", ")", "upper", "=", "as_value_expr", "(", "upper", ")", "op", "=", "ops", ".", "Between", "(", "arg", ",", "lower", ",", "upper", ")", "...
[ 826, 0 ]
[ 839, 23 ]
python
en
['en', 'error', 'th']
False
isin
(arg, values)
Check whether the value expression is contained within the indicated list of values. Parameters ---------- values : list, tuple, or array expression The values can be scalar or array-like. Each of them must be comparable with the calling expression, or None (NULL). Examples --...
Check whether the value expression is contained within the indicated list of values.
def isin(arg, values): """ Check whether the value expression is contained within the indicated list of values. Parameters ---------- values : list, tuple, or array expression The values can be scalar or array-like. Each of them must be comparable with the calling expression, or Non...
[ "def", "isin", "(", "arg", ",", "values", ")", ":", "op", "=", "ops", ".", "Contains", "(", "arg", ",", "values", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 842, 0 ]
[ 866, 23 ]
python
en
['en', 'error', 'th']
False
notin
(arg, values)
Like isin, but checks whether this expression's value(s) are not contained in the passed values. See isin docs for full usage.
Like isin, but checks whether this expression's value(s) are not contained in the passed values. See isin docs for full usage.
def notin(arg, values): """ Like isin, but checks whether this expression's value(s) are not contained in the passed values. See isin docs for full usage. """ op = ops.NotContains(arg, values) return op.to_expr()
[ "def", "notin", "(", "arg", ",", "values", ")", ":", "op", "=", "ops", ".", "NotContains", "(", "arg", ",", "values", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 869, 0 ]
[ 875, 23 ]
python
en
['en', 'error', 'th']
False
substitute
(arg, value, replacement=None, else_=None)
Substitute (replace) one or more values in a value expression Parameters ---------- value : expr-like or dict replacement : expr-like, optional If an expression is passed to value, this must be passed else_ : expr, optional Returns ------- replaced : case statement (for now!...
Substitute (replace) one or more values in a value expression
def substitute(arg, value, replacement=None, else_=None): """ Substitute (replace) one or more values in a value expression Parameters ---------- value : expr-like or dict replacement : expr-like, optional If an expression is passed to value, this must be passed else_ : expr, optional...
[ "def", "substitute", "(", "arg", ",", "value", ",", "replacement", "=", "None", ",", "else_", "=", "None", ")", ":", "expr", "=", "arg", ".", "case", "(", ")", "if", "isinstance", "(", "value", ",", "dict", ")", ":", "for", "k", ",", "v", "in", ...
[ 892, 0 ]
[ 920, 21 ]
python
en
['en', 'error', 'th']
False
_case
(arg)
Create a new SimpleCaseBuilder to chain multiple if-else statements. Add new search expressions with the .when method. These must be comparable with this array expression. Conclude by calling .end() Returns ------- builder : CaseBuilder Examples -------- >>> import ibis >>> t = ibi...
Create a new SimpleCaseBuilder to chain multiple if-else statements. Add new search expressions with the .when method. These must be comparable with this array expression. Conclude by calling .end()
def _case(arg): """Create a new SimpleCaseBuilder to chain multiple if-else statements. Add new search expressions with the .when method. These must be comparable with this array expression. Conclude by calling .end() Returns ------- builder : CaseBuilder Examples -------- >>> impo...
[ "def", "_case", "(", "arg", ")", ":", "return", "ops", ".", "SimpleCaseBuilder", "(", "arg", ")" ]
[ 923, 0 ]
[ 967, 37 ]
python
en
['en', 'en', 'en']
True
cases
(arg, case_result_pairs, default=None)
Create a case expression in one shot. Returns ------- case_expr : SimpleCase
Create a case expression in one shot.
def cases(arg, case_result_pairs, default=None): """ Create a case expression in one shot. Returns ------- case_expr : SimpleCase """ builder = arg.case() for case, result in case_result_pairs: builder = builder.when(case, result) if default is not None: builder = bu...
[ "def", "cases", "(", "arg", ",", "case_result_pairs", ",", "default", "=", "None", ")", ":", "builder", "=", "arg", ".", "case", "(", ")", "for", "case", ",", "result", "in", "case_result_pairs", ":", "builder", "=", "builder", ".", "when", "(", "case"...
[ 970, 0 ]
[ 983, 24 ]
python
en
['en', 'error', 'th']
False
nth
(arg, k)
Analytic operation computing nth value from start of sequence Parameters ---------- arg : array expression k : int Desired rank value Returns ------- nth : type of argument
Analytic operation computing nth value from start of sequence
def nth(arg, k): """ Analytic operation computing nth value from start of sequence Parameters ---------- arg : array expression k : int Desired rank value Returns ------- nth : type of argument """ return ops.NthValue(arg, k).to_expr()
[ "def", "nth", "(", "arg", ",", "k", ")", ":", "return", "ops", ".", "NthValue", "(", "arg", ",", "k", ")", ".", "to_expr", "(", ")" ]
[ 1044, 0 ]
[ 1058, 41 ]
python
en
['en', 'error', 'th']
False
distinct
(arg)
Compute set of unique values occurring in this array. Can not be used in conjunction with other array expressions from the same context (because it's a cardinality-modifying pseudo-reduction).
Compute set of unique values occurring in this array. Can not be used in conjunction with other array expressions from the same context (because it's a cardinality-modifying pseudo-reduction).
def distinct(arg): """ Compute set of unique values occurring in this array. Can not be used in conjunction with other array expressions from the same context (because it's a cardinality-modifying pseudo-reduction). """ op = ops.DistinctColumn(arg) return op.to_expr()
[ "def", "distinct", "(", "arg", ")", ":", "op", "=", "ops", ".", "DistinctColumn", "(", "arg", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1061, 0 ]
[ 1068, 23 ]
python
en
['en', 'error', 'th']
False
topk
(arg, k, by=None)
Returns ------- topk : TopK filter expression
Returns ------- topk : TopK filter expression
def topk(arg, k, by=None): """ Returns ------- topk : TopK filter expression """ op = ops.TopK(arg, k, by=by) return op.to_expr()
[ "def", "topk", "(", "arg", ",", "k", ",", "by", "=", "None", ")", ":", "op", "=", "ops", ".", "TopK", "(", "arg", ",", "k", ",", "by", "=", "by", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1071, 0 ]
[ 1078, 23 ]
python
en
['en', 'error', 'th']
False
_generic_summary
(arg, exact_nunique=False, prefix=None)
Compute a set of summary metrics from the input value expression Parameters ---------- arg : value expression exact_nunique : boolean, default False Compute the exact number of distinct values (slower) prefix : string, default None String prefix for metric names Returns --...
Compute a set of summary metrics from the input value expression
def _generic_summary(arg, exact_nunique=False, prefix=None): """ Compute a set of summary metrics from the input value expression Parameters ---------- arg : value expression exact_nunique : boolean, default False Compute the exact number of distinct values (slower) prefix : string, d...
[ "def", "_generic_summary", "(", "arg", ",", "exact_nunique", "=", "False", ",", "prefix", "=", "None", ")", ":", "metrics", "=", "[", "arg", ".", "count", "(", ")", ",", "arg", ".", "isnull", "(", ")", ".", "sum", "(", ")", ".", "name", "(", "'nu...
[ 1085, 0 ]
[ 1112, 49 ]
python
en
['en', 'error', 'th']
False
_numeric_summary
(arg, exact_nunique=False, prefix=None)
Compute a set of summary metrics from the input numeric value expression Parameters ---------- arg : numeric value expression exact_nunique : boolean, default False prefix : string, default None String prefix for metric names Returns ------- summary : (count, # nulls, min, m...
Compute a set of summary metrics from the input numeric value expression
def _numeric_summary(arg, exact_nunique=False, prefix=None): """ Compute a set of summary metrics from the input numeric value expression Parameters ---------- arg : numeric value expression exact_nunique : boolean, default False prefix : string, default None String prefix for metric ...
[ "def", "_numeric_summary", "(", "arg", ",", "exact_nunique", "=", "False", ",", "prefix", "=", "None", ")", ":", "metrics", "=", "[", "arg", ".", "count", "(", ")", ",", "arg", ".", "isnull", "(", ")", ".", "sum", "(", ")", ".", "name", "(", "'nu...
[ 1115, 0 ]
[ 1145, 49 ]
python
en
['en', 'error', 'th']
False
round
(arg, digits=None)
Round values either to integer or indicated number of decimal places. Returns ------- rounded : type depending on digits argument digits None or 0 decimal types: decimal other numeric types: bigint digits nonzero decimal types: decimal other numeric types: d...
Round values either to integer or indicated number of decimal places.
def round(arg, digits=None): """ Round values either to integer or indicated number of decimal places. Returns ------- rounded : type depending on digits argument digits None or 0 decimal types: decimal other numeric types: bigint digits nonzero decimal types: de...
[ "def", "round", "(", "arg", ",", "digits", "=", "None", ")", ":", "op", "=", "ops", ".", "Round", "(", "arg", ",", "digits", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1199, 0 ]
[ 1214, 23 ]
python
en
['en', 'error', 'th']
False
log
(arg, base=None)
Perform the logarithm using a specified base Parameters ---------- base : number, default None If None, base e is used Returns ------- logarithm : double type
Perform the logarithm using a specified base
def log(arg, base=None): """ Perform the logarithm using a specified base Parameters ---------- base : number, default None If None, base e is used Returns ------- logarithm : double type """ op = ops.Log(arg, base) return op.to_expr()
[ "def", "log", "(", "arg", ",", "base", "=", "None", ")", ":", "op", "=", "ops", ".", "Log", "(", "arg", ",", "base", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1217, 0 ]
[ 1231, 23 ]
python
en
['en', 'error', 'th']
False
clip
(arg, lower=None, upper=None)
Trim values at input threshold(s). Parameters ---------- lower : float upper : float Returns ------- clipped : same as type of the input
Trim values at input threshold(s).
def clip(arg, lower=None, upper=None): """ Trim values at input threshold(s). Parameters ---------- lower : float upper : float Returns ------- clipped : same as type of the input """ if lower is None and upper is None: raise ValueError("at least one of lower and " ...
[ "def", "clip", "(", "arg", ",", "lower", "=", "None", ",", "upper", "=", "None", ")", ":", "if", "lower", "is", "None", "and", "upper", "is", "None", ":", "raise", "ValueError", "(", "\"at least one of lower and \"", "\"upper must be provided\"", ")", "op", ...
[ 1234, 0 ]
[ 1252, 23 ]
python
en
['en', 'error', 'th']
False
quantile
(arg, quantile, interpolation='linear')
Return value at the given quantile, a la numpy.percentile. Parameters ---------- quantile : float/int or array-like 0 <= quantile <= 1, the quantile(s) to compute interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'} This optional parameter specifies the interpolati...
Return value at the given quantile, a la numpy.percentile.
def quantile(arg, quantile, interpolation='linear'): """ Return value at the given quantile, a la numpy.percentile. Parameters ---------- quantile : float/int or array-like 0 <= quantile <= 1, the quantile(s) to compute interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'...
[ "def", "quantile", "(", "arg", ",", "quantile", ",", "interpolation", "=", "'linear'", ")", ":", "if", "isinstance", "(", "quantile", ",", "collections", ".", "Sequence", ")", ":", "op", "=", "ops", ".", "MultiQuantile", "(", "arg", ",", "quantile", ",",...
[ 1255, 0 ]
[ 1285, 23 ]
python
en
['en', 'error', 'th']
False
_integer_to_timestamp
(arg, unit='s')
Convert integer UNIX timestamp (at some resolution) to a timestamp type Parameters ---------- unit : {'s', 'ms', 'us'} Second (s), millisecond (ms), or microsecond (us) resolution Returns ------- timestamp : timestamp value expression
Convert integer UNIX timestamp (at some resolution) to a timestamp type
def _integer_to_timestamp(arg, unit='s'): """ Convert integer UNIX timestamp (at some resolution) to a timestamp type Parameters ---------- unit : {'s', 'ms', 'us'} Second (s), millisecond (ms), or microsecond (us) resolution Returns ------- timestamp : timestamp value expression...
[ "def", "_integer_to_timestamp", "(", "arg", ",", "unit", "=", "'s'", ")", ":", "op", "=", "ops", ".", "TimestampFromUNIX", "(", "arg", ",", "unit", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1288, 0 ]
[ 1302, 23 ]
python
en
['en', 'error', 'th']
False
_integer_to_interval
(arg, unit='s')
Convert integer interval with the same inner type Parameters ---------- unit : {'Y', 'M', 'W', 'D', 'h', 'm', s', 'ms', 'us', 'ns'} Returns ------- interval : interval value expression
Convert integer interval with the same inner type
def _integer_to_interval(arg, unit='s'): """ Convert integer interval with the same inner type Parameters ---------- unit : {'Y', 'M', 'W', 'D', 'h', 'm', s', 'ms', 'us', 'ns'} Returns ------- interval : interval value expression """ op = ops.IntervalFromInteger(arg, unit) ...
[ "def", "_integer_to_interval", "(", "arg", ",", "unit", "=", "'s'", ")", ":", "op", "=", "ops", ".", "IntervalFromInteger", "(", "arg", ",", "unit", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1305, 0 ]
[ 1318, 23 ]
python
en
['en', 'error', 'th']
False
convert_base
(arg, from_base, to_base)
Convert number (as integer or string) from one base to another Parameters ---------- arg : string or integer from_base : integer to_base : integer Returns ------- converted : string
Convert number (as integer or string) from one base to another
def convert_base(arg, from_base, to_base): """ Convert number (as integer or string) from one base to another Parameters ---------- arg : string or integer from_base : integer to_base : integer Returns ------- converted : string """ return ops.BaseConvert(arg, from_base...
[ "def", "convert_base", "(", "arg", ",", "from_base", ",", "to_base", ")", ":", "return", "ops", ".", "BaseConvert", "(", "arg", ",", "from_base", ",", "to_base", ")", ".", "to_expr", "(", ")" ]
[ 1412, 0 ]
[ 1426, 61 ]
python
en
['en', 'error', 'th']
False
std
(arg, where=None, how='sample')
Compute standard deviation of numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- stdev : double scalar
Compute standard deviation of numeric array
def std(arg, where=None, how='sample'): """ Compute standard deviation of numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- stdev : double scalar """ expr = ops.StandardDev(arg, how, where).to_expr() expr = expr.name('std') re...
[ "def", "std", "(", "arg", ",", "where", "=", "None", ",", "how", "=", "'sample'", ")", ":", "expr", "=", "ops", ".", "StandardDev", "(", "arg", ",", "how", ",", "where", ")", ".", "to_expr", "(", ")", "expr", "=", "expr", ".", "name", "(", "'st...
[ 1443, 0 ]
[ 1457, 15 ]
python
en
['en', 'error', 'th']
False
variance
(arg, where=None, how='sample')
Compute standard deviation of numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- stdev : double scalar
Compute standard deviation of numeric array
def variance(arg, where=None, how='sample'): """ Compute standard deviation of numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- stdev : double scalar """ expr = ops.Variance(arg, how, where).to_expr() expr = expr.name('var') ...
[ "def", "variance", "(", "arg", ",", "where", "=", "None", ",", "how", "=", "'sample'", ")", ":", "expr", "=", "ops", ".", "Variance", "(", "arg", ",", "how", ",", "where", ")", ".", "to_expr", "(", ")", "expr", "=", "expr", ".", "name", "(", "'...
[ 1460, 0 ]
[ 1474, 15 ]
python
en
['en', 'error', 'th']
False
correlation
(left, right, where=None, how='sample')
Compute correlation of two numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- corr : double scalar
Compute correlation of two numeric array
def correlation(left, right, where=None, how='sample'): """ Compute correlation of two numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- corr : double scalar """ expr = ops.Correlation(left, right, how, where).to_expr() return exp...
[ "def", "correlation", "(", "left", ",", "right", ",", "where", "=", "None", ",", "how", "=", "'sample'", ")", ":", "expr", "=", "ops", ".", "Correlation", "(", "left", ",", "right", ",", "how", ",", "where", ")", ".", "to_expr", "(", ")", "return",...
[ 1477, 0 ]
[ 1490, 15 ]
python
en
['en', 'error', 'th']
False
covariance
(left, right, where=None, how='sample')
Compute covariance of two numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- cov : double scalar
Compute covariance of two numeric array
def covariance(left, right, where=None, how='sample'): """ Compute covariance of two numeric array Parameters ---------- how : {'sample', 'pop'}, default 'sample' Returns ------- cov : double scalar """ expr = ops.Covariance(left, right, how, where).to_expr() return expr
[ "def", "covariance", "(", "left", ",", "right", ",", "where", "=", "None", ",", "how", "=", "'sample'", ")", ":", "expr", "=", "ops", ".", "Covariance", "(", "left", ",", "right", ",", "how", ",", "where", ")", ".", "to_expr", "(", ")", "return", ...
[ 1493, 0 ]
[ 1506, 15 ]
python
en
['en', 'error', 'th']
False
ifelse
(arg, true_expr, false_expr)
Shorthand for implementing ternary expressions bool_expr.ifelse(0, 1) e.g., in SQL: CASE WHEN bool_expr THEN 0 else 1 END
Shorthand for implementing ternary expressions
def ifelse(arg, true_expr, false_expr): """ Shorthand for implementing ternary expressions bool_expr.ifelse(0, 1) e.g., in SQL: CASE WHEN bool_expr THEN 0 else 1 END """ # Result will be the result of promotion of true/false exprs. These # might be conflicting types; same type resolution as...
[ "def", "ifelse", "(", "arg", ",", "true_expr", ",", "false_expr", ")", ":", "# Result will be the result of promotion of true/false exprs. These", "# might be conflicting types; same type resolution as case expressions", "# must be used.", "case", "=", "ops", ".", "SearchedCaseBuil...
[ 1547, 0 ]
[ 1558, 60 ]
python
en
['en', 'error', 'th']
False
_string_substr
(self, start, length=None)
Pull substrings out of each string value by position and maximum length. Parameters ---------- start : int First character to start splitting, indices starting at 0 (like Python) length : int, optional Maximum length of each substring. If not supplied, splits each string ...
Pull substrings out of each string value by position and maximum length.
def _string_substr(self, start, length=None): """ Pull substrings out of each string value by position and maximum length. Parameters ---------- start : int First character to start splitting, indices starting at 0 (like Python) length : int, optional Maximum length of eac...
[ "def", "_string_substr", "(", "self", ",", "start", ",", "length", "=", "None", ")", ":", "op", "=", "ops", ".", "Substring", "(", "self", ",", "start", ",", "length", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 1590, 0 ]
[ 1609, 23 ]
python
en
['en', 'error', 'th']
False
_string_left
(self, nchars)
Return left-most up to N characters from each string. Convenience use of substr. Returns ------- substrings : type of caller
Return left-most up to N characters from each string. Convenience use of substr.
def _string_left(self, nchars): """ Return left-most up to N characters from each string. Convenience use of substr. Returns ------- substrings : type of caller """ return self.substr(0, length=nchars)
[ "def", "_string_left", "(", "self", ",", "nchars", ")", ":", "return", "self", ".", "substr", "(", "0", ",", "length", "=", "nchars", ")" ]
[ 1612, 0 ]
[ 1621, 40 ]
python
en
['en', 'error', 'th']
False
_string_right
(self, nchars)
Return up to nchars starting from end of each string. Returns ------- substrings : type of caller
Return up to nchars starting from end of each string.
def _string_right(self, nchars): """ Return up to nchars starting from end of each string. Returns ------- substrings : type of caller """ return ops.StrRight(self, nchars).to_expr()
[ "def", "_string_right", "(", "self", ",", "nchars", ")", ":", "return", "ops", ".", "StrRight", "(", "self", ",", "nchars", ")", ".", "to_expr", "(", ")" ]
[ 1624, 0 ]
[ 1632, 47 ]
python
en
['en', 'error', 'th']
False
repeat
(self, n)
Returns the argument string repeated n times Parameters ---------- n : int Returns ------- result : string
Returns the argument string repeated n times
def repeat(self, n): """ Returns the argument string repeated n times Parameters ---------- n : int Returns ------- result : string """ return ops.Repeat(self, n).to_expr()
[ "def", "repeat", "(", "self", ",", "n", ")", ":", "return", "ops", ".", "Repeat", "(", "self", ",", "n", ")", ".", "to_expr", "(", ")" ]
[ 1635, 0 ]
[ 1647, 40 ]
python
en
['en', 'error', 'th']
False
_translate
(self, from_str, to_str)
Returns string with set of 'from' characters replaced by set of 'to' characters. from_str[x] is replaced by to_str[x]. To avoid unexpected behavior, from_str should be shorter than to_string. Parameters ---------- from_str : string to_str : string Examples -------- >>>...
Returns string with set of 'from' characters replaced by set of 'to' characters. from_str[x] is replaced by to_str[x]. To avoid unexpected behavior, from_str should be shorter than to_string.
def _translate(self, from_str, to_str): """ Returns string with set of 'from' characters replaced by set of 'to' characters. from_str[x] is replaced by to_str[x]. To avoid unexpected behavior, from_str should be shorter than to_string. Parameters ---------- from_str : string to_...
[ "def", "_translate", "(", "self", ",", "from_str", ",", "to_str", ")", ":", "return", "ops", ".", "Translate", "(", "self", ",", "from_str", ",", "to_str", ")", ".", "to_expr", "(", ")" ]
[ 1650, 0 ]
[ 1674, 58 ]
python
en
['en', 'error', 'th']
False
_string_find
(self, substr, start=None, end=None)
Returns position (0 indexed) of first occurence of substring, optionally after a particular position (0 indexed) Parameters ---------- substr : string start : int, default None end : int, default None Not currently implemented Returns ------- position : int, 0 indexed ...
Returns position (0 indexed) of first occurence of substring, optionally after a particular position (0 indexed)
def _string_find(self, substr, start=None, end=None): """ Returns position (0 indexed) of first occurence of substring, optionally after a particular position (0 indexed) Parameters ---------- substr : string start : int, default None end : int, default None Not currently implem...
[ "def", "_string_find", "(", "self", ",", "substr", ",", "start", "=", "None", ",", "end", "=", "None", ")", ":", "if", "end", "is", "not", "None", ":", "raise", "NotImplementedError", "return", "ops", ".", "StringFind", "(", "self", ",", "substr", ",",...
[ 1677, 0 ]
[ 1695, 61 ]
python
en
['en', 'error', 'th']
False
_lpad
(self, length, pad=' ')
Returns string of given length by truncating (on right) or padding (on left) original string Parameters ---------- length : int pad : string, default is ' ' Examples -------- >>> import ibis >>> table = ibis.table([('strings', 'string')]) >>> expr = table.strings.lpad(5, '...
Returns string of given length by truncating (on right) or padding (on left) original string
def _lpad(self, length, pad=' '): """ Returns string of given length by truncating (on right) or padding (on left) original string Parameters ---------- length : int pad : string, default is ' ' Examples -------- >>> import ibis >>> table = ibis.table([('strings', 'string')...
[ "def", "_lpad", "(", "self", ",", "length", ",", "pad", "=", "' '", ")", ":", "return", "ops", ".", "LPad", "(", "self", ",", "length", ",", "pad", ")", ".", "to_expr", "(", ")" ]
[ 1698, 0 ]
[ 1720, 48 ]
python
en
['en', 'error', 'th']
False
_rpad
(self, length, pad=' ')
Returns string of given length by truncating (on right) or padding (on right) original string Parameters ---------- length : int pad : string, default is ' ' Examples -------- >>> import ibis >>> table = ibis.table([('string_col', 'string')]) >>> expr = table.string_col.rp...
Returns string of given length by truncating (on right) or padding (on right) original string
def _rpad(self, length, pad=' '): """ Returns string of given length by truncating (on right) or padding (on right) original string Parameters ---------- length : int pad : string, default is ' ' Examples -------- >>> import ibis >>> table = ibis.table([('string_col', 'stri...
[ "def", "_rpad", "(", "self", ",", "length", ",", "pad", "=", "' '", ")", ":", "return", "ops", ".", "RPad", "(", "self", ",", "length", ",", "pad", ")", ".", "to_expr", "(", ")" ]
[ 1723, 0 ]
[ 1745, 48 ]
python
en
['en', 'error', 'th']
False
_find_in_set
(self, str_list)
Returns postion (0 indexed) of first occurence of argument within a list of strings. No string in list can have a comma Returns -1 if search string isn't found or if search string contains ',' Parameters ---------- str_list : list of strings Examples -------- >>> import ibis ...
Returns postion (0 indexed) of first occurence of argument within a list of strings. No string in list can have a comma Returns -1 if search string isn't found or if search string contains ','
def _find_in_set(self, str_list): """ Returns postion (0 indexed) of first occurence of argument within a list of strings. No string in list can have a comma Returns -1 if search string isn't found or if search string contains ',' Parameters ---------- str_list : list of strings Examp...
[ "def", "_find_in_set", "(", "self", ",", "str_list", ")", ":", "return", "ops", ".", "FindInSet", "(", "self", ",", "str_list", ")", ".", "to_expr", "(", ")" ]
[ 1748, 0 ]
[ 1769, 50 ]
python
en
['en', 'error', 'th']
False
_string_join
(self, strings)
Joins a list of strings together using the calling string as a separator Parameters ---------- strings : list of strings Examples -------- >>> import ibis >>> sep = ibis.literal(',') >>> result = sep.join(['a', 'b', 'c']) Returns ------- joined : string
Joins a list of strings together using the calling string as a separator
def _string_join(self, strings): """ Joins a list of strings together using the calling string as a separator Parameters ---------- strings : list of strings Examples -------- >>> import ibis >>> sep = ibis.literal(',') >>> result = sep.join(['a', 'b', 'c']) Returns --...
[ "def", "_string_join", "(", "self", ",", "strings", ")", ":", "return", "ops", ".", "StringJoin", "(", "self", ",", "strings", ")", ".", "to_expr", "(", ")" ]
[ 1772, 0 ]
[ 1790, 50 ]
python
en
['en', 'error', 'th']
False
_string_like
(self, patterns)
Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use % as a multiple-character wildcard or _ (underscore) as a single-character wildcard. Use re_search or rlike for regex-based matching. Parameters ---------- pattern : str or List[str] A pattern or list of pa...
Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use % as a multiple-character wildcard or _ (underscore) as a single-character wildcard.
def _string_like(self, patterns): """ Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use % as a multiple-character wildcard or _ (underscore) as a single-character wildcard. Use re_search or rlike for regex-based matching. Parameters ---------- pattern : str or ...
[ "def", "_string_like", "(", "self", ",", "patterns", ")", ":", "return", "functools", ".", "reduce", "(", "operator", ".", "or_", ",", "(", "ops", ".", "StringSQLLike", "(", "self", ",", "pattern", ")", ".", "to_expr", "(", ")", "for", "pattern", "in",...
[ 1793, 0 ]
[ 1818, 5 ]
python
en
['en', 'error', 'th']
False
_string_ilike
(self, patterns)
Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use % as a multiple-character wildcard or _ (underscore) as a single-character wildcard. Use re_search or rlike for regex-based matching. Parameters ---------- pattern : str or List[str] A pattern or list of pa...
Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use % as a multiple-character wildcard or _ (underscore) as a single-character wildcard.
def _string_ilike(self, patterns): """ Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use % as a multiple-character wildcard or _ (underscore) as a single-character wildcard. Use re_search or rlike for regex-based matching. Parameters ---------- pattern : str or...
[ "def", "_string_ilike", "(", "self", ",", "patterns", ")", ":", "return", "functools", ".", "reduce", "(", "operator", ".", "or_", ",", "(", "ops", ".", "StringSQLILike", "(", "self", ",", "pattern", ")", ".", "to_expr", "(", ")", "for", "pattern", "in...
[ 1821, 0 ]
[ 1846, 5 ]
python
en
['en', 'error', 'th']
False
re_search
(arg, pattern)
Search string values using a regular expression. Returns True if the regex matches a string and False otherwise. Parameters ---------- pattern : string (regular expression string) Returns ------- searched : boolean value
Search string values using a regular expression. Returns True if the regex matches a string and False otherwise.
def re_search(arg, pattern): """ Search string values using a regular expression. Returns True if the regex matches a string and False otherwise. Parameters ---------- pattern : string (regular expression string) Returns ------- searched : boolean value """ return ops.Regex...
[ "def", "re_search", "(", "arg", ",", "pattern", ")", ":", "return", "ops", ".", "RegexSearch", "(", "arg", ",", "pattern", ")", ".", "to_expr", "(", ")" ]
[ 1849, 0 ]
[ 1862, 50 ]
python
en
['en', 'error', 'th']
False
regex_extract
(arg, pattern, index)
Returns specified index, 0 indexed, from string based on regex pattern given Parameters ---------- pattern : string (regular expression string) index : int, 0 indexed Returns ------- extracted : string
Returns specified index, 0 indexed, from string based on regex pattern given
def regex_extract(arg, pattern, index): """ Returns specified index, 0 indexed, from string based on regex pattern given Parameters ---------- pattern : string (regular expression string) index : int, 0 indexed Returns ------- extracted : string """ return ops.RegexExtr...
[ "def", "regex_extract", "(", "arg", ",", "pattern", ",", "index", ")", ":", "return", "ops", ".", "RegexExtract", "(", "arg", ",", "pattern", ",", "index", ")", ".", "to_expr", "(", ")" ]
[ 1865, 0 ]
[ 1879, 58 ]
python
en
['en', 'error', 'th']
False
regex_replace
(arg, pattern, replacement)
Replaces match found by regex with replacement string. Replacement string can also be a regex Parameters ---------- pattern : string (regular expression string) replacement : string (can be regular expression string) Examples -------- >>> import ibis >>> table = ibis.table([('...
Replaces match found by regex with replacement string. Replacement string can also be a regex
def regex_replace(arg, pattern, replacement): """ Replaces match found by regex with replacement string. Replacement string can also be a regex Parameters ---------- pattern : string (regular expression string) replacement : string (can be regular expression string) Examples ------...
[ "def", "regex_replace", "(", "arg", ",", "pattern", ",", "replacement", ")", ":", "return", "ops", ".", "RegexReplace", "(", "arg", ",", "pattern", ",", "replacement", ")", ".", "to_expr", "(", ")" ]
[ 1882, 0 ]
[ 1902, 64 ]
python
en
['en', 'error', 'th']
False
_string_replace
(arg, pattern, replacement)
Replaces each exactly occurrence of pattern with given replacement string. Like Python built-in str.replace Parameters ---------- pattern : string replacement : string Examples -------- >>> import ibis >>> table = ibis.table([('strings', 'string')]) >>> result = table.stri...
Replaces each exactly occurrence of pattern with given replacement string. Like Python built-in str.replace
def _string_replace(arg, pattern, replacement): """ Replaces each exactly occurrence of pattern with given replacement string. Like Python built-in str.replace Parameters ---------- pattern : string replacement : string Examples -------- >>> import ibis >>> table = ibis.tab...
[ "def", "_string_replace", "(", "arg", ",", "pattern", ",", "replacement", ")", ":", "return", "ops", ".", "StringReplace", "(", "arg", ",", "pattern", ",", "replacement", ")", ".", "to_expr", "(", ")" ]
[ 1905, 0 ]
[ 1925, 65 ]
python
en
['en', 'error', 'th']
False
to_timestamp
(arg, format_str, timezone=None)
Parses a string and returns a timestamp. Parameters ---------- format_str : A format string potentially of the type '%Y-%m-%d' timezone : An optional string indicating the timezone, i.e. 'America/New_York' Examples -------- >>> import ibis >>> date_as_str = ibis.literal('2...
Parses a string and returns a timestamp.
def to_timestamp(arg, format_str, timezone=None): """ Parses a string and returns a timestamp. Parameters ---------- format_str : A format string potentially of the type '%Y-%m-%d' timezone : An optional string indicating the timezone, i.e. 'America/New_York' Examples -------- ...
[ "def", "to_timestamp", "(", "arg", ",", "format_str", ",", "timezone", "=", "None", ")", ":", "return", "ops", ".", "StringToTimestamp", "(", "arg", ",", "format_str", ",", "timezone", ")", ".", "to_expr", "(", ")" ]
[ 1928, 0 ]
[ 1948, 69 ]
python
en
['en', 'error', 'th']
False
parse_url
(arg, extract, key=None)
Returns the portion of a URL corresponding to a part specified by 'extract' Can optionally specify a key to retrieve an associated value if extract parameter is 'QUERY' Parameters ---------- extract : one of {'PROTOCOL', 'HOST', 'PATH', 'REF', 'AUTHORITY', 'FILE', 'USERINFO...
Returns the portion of a URL corresponding to a part specified by 'extract' Can optionally specify a key to retrieve an associated value if extract parameter is 'QUERY'
def parse_url(arg, extract, key=None): """ Returns the portion of a URL corresponding to a part specified by 'extract' Can optionally specify a key to retrieve an associated value if extract parameter is 'QUERY' Parameters ---------- extract : one of {'PROTOCOL', 'HOST', 'PATH', 'REF', ...
[ "def", "parse_url", "(", "arg", ",", "extract", ",", "key", "=", "None", ")", ":", "return", "ops", ".", "ParseURL", "(", "arg", ",", "extract", ",", "key", ")", ".", "to_expr", "(", ")" ]
[ 1951, 0 ]
[ 1974, 52 ]
python
en
['en', 'error', 'th']
False
_string_contains
(arg, substr)
Determine if indicated string is exactly contained in the calling string. Parameters ---------- substr : str or ibis.expr.types.StringValue Returns ------- contains : ibis.expr.types.BooleanValue
Determine if indicated string is exactly contained in the calling string.
def _string_contains(arg, substr): """ Determine if indicated string is exactly contained in the calling string. Parameters ---------- substr : str or ibis.expr.types.StringValue Returns ------- contains : ibis.expr.types.BooleanValue """ return arg.find(substr) >= 0
[ "def", "_string_contains", "(", "arg", ",", "substr", ")", ":", "return", "arg", ".", "find", "(", "substr", ")", ">=", "0" ]
[ 1977, 0 ]
[ 1989, 32 ]
python
en
['en', 'error', 'th']
False
_string_split
(arg, delimiter)
Split `arg` on `delimiter`. Parameters ---------- arg : str or ibis.expr.types.StringValue delimiter : str or ibis.expr.types.StringValue Returns ------- splitsville : Array[String]
Split `arg` on `delimiter`.
def _string_split(arg, delimiter): """Split `arg` on `delimiter`. Parameters ---------- arg : str or ibis.expr.types.StringValue delimiter : str or ibis.expr.types.StringValue Returns ------- splitsville : Array[String] """ return ops.StringSplit(arg, delimiter).to_expr()
[ "def", "_string_split", "(", "arg", ",", "delimiter", ")", ":", "return", "ops", ".", "StringSplit", "(", "arg", ",", "delimiter", ")", ".", "to_expr", "(", ")" ]
[ 1992, 0 ]
[ 2004, 52 ]
python
da
['en', 'da', 'nl']
False
_array_slice
(array, index)
Slice or index `array` at `index`. Parameters ---------- index : int or ibis.expr.types.IntegerValue or slice Returns ------- sliced_array : ibis.expr.types.ValueExpr If `index` is an ``int`` or :class:`~ibis.expr.types.IntegerValue` then the return type is the element type of ...
Slice or index `array` at `index`.
def _array_slice(array, index): """Slice or index `array` at `index`. Parameters ---------- index : int or ibis.expr.types.IntegerValue or slice Returns ------- sliced_array : ibis.expr.types.ValueExpr If `index` is an ``int`` or :class:`~ibis.expr.types.IntegerValue` then ...
[ "def", "_array_slice", "(", "array", ",", "index", ")", ":", "if", "isinstance", "(", "index", ",", "slice", ")", ":", "start", "=", "index", ".", "start", "stop", "=", "index", ".", "stop", "if", "(", "(", "start", "is", "not", "None", "and", "sta...
[ 2087, 0 ]
[ 2120, 23 ]
python
en
['en', 'da', 'en']
True
get
(expr, key, default=None)
Return the mapped value for this key, or the default if the key does not exist Parameters ---------- key : any default : any
Return the mapped value for this key, or the default if the key does not exist
def get(expr, key, default=None): """ Return the mapped value for this key, or the default if the key does not exist Parameters ---------- key : any default : any """ return ops.MapValueOrDefaultForKey(expr, key, default).to_expr()
[ "def", "get", "(", "expr", ",", "key", ",", "default", "=", "None", ")", ":", "return", "ops", ".", "MapValueOrDefaultForKey", "(", "expr", ",", "key", ",", "default", ")", ".", "to_expr", "(", ")" ]
[ 2138, 0 ]
[ 2148, 68 ]
python
en
['en', 'error', 'th']
False
_struct_get_field
(expr, field_name)
Get the `field_name` field from the ``Struct`` expression `expr`. Parameters ---------- field_name : str The name of the field to access from the ``Struct`` typed expression `expr`. Must be a Python ``str`` type; programmatic struct field access is not yet supported. Returns ...
Get the `field_name` field from the ``Struct`` expression `expr`.
def _struct_get_field(expr, field_name): """Get the `field_name` field from the ``Struct`` expression `expr`. Parameters ---------- field_name : str The name of the field to access from the ``Struct`` typed expression `expr`. Must be a Python ``str`` type; programmatic struct field ...
[ "def", "_struct_get_field", "(", "expr", ",", "field_name", ")", ":", "return", "ops", ".", "StructField", "(", "expr", ",", "field_name", ")", ".", "to_expr", "(", ")", ".", "name", "(", "field_name", ")" ]
[ 2167, 0 ]
[ 2182, 71 ]
python
en
['en', 'en', 'en']
True
_timestamp_truncate
(arg, unit)
Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling. Parameters ---------- unit : string, one of below table 'Y': year 'Q': quarter 'M': month 'W': week 'D': day 'h': hour 'm': minute 's': second 'ms': mi...
Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling.
def _timestamp_truncate(arg, unit): """ Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling. Parameters ---------- unit : string, one of below table 'Y': year 'Q': quarter 'M': month 'W': week 'D': day 'h': hour '...
[ "def", "_timestamp_truncate", "(", "arg", ",", "unit", ")", ":", "return", "ops", ".", "TimestampTruncate", "(", "arg", ",", "unit", ")", ".", "to_expr", "(", ")" ]
[ 2196, 0 ]
[ 2220, 53 ]
python
en
['en', 'error', 'th']
False
_timestamp_strftime
(arg, format_str)
Format timestamp according to the passed format string. Format string may depend on backend, but we try to conform to ANSI strftime (e.g. Python built-in datetime.strftime) Parameters ---------- format_str : string Returns ------- formatted : string
Format timestamp according to the passed format string. Format string may depend on backend, but we try to conform to ANSI strftime (e.g. Python built-in datetime.strftime)
def _timestamp_strftime(arg, format_str): """ Format timestamp according to the passed format string. Format string may depend on backend, but we try to conform to ANSI strftime (e.g. Python built-in datetime.strftime) Parameters ---------- format_str : string Returns ------- f...
[ "def", "_timestamp_strftime", "(", "arg", ",", "format_str", ")", ":", "return", "ops", ".", "Strftime", "(", "arg", ",", "format_str", ")", ".", "to_expr", "(", ")" ]
[ 2223, 0 ]
[ 2237, 50 ]
python
en
['en', 'error', 'th']
False
_timestamp_time
(arg)
Return a Time node for a Timestamp We can then perform certain operations on this node w/o actually instantiating the underlying structure (which is inefficient in pandas/numpy) Returns ------- Time node
Return a Time node for a Timestamp We can then perform certain operations on this node w/o actually instantiating the underlying structure (which is inefficient in pandas/numpy)
def _timestamp_time(arg): """ Return a Time node for a Timestamp We can then perform certain operations on this node w/o actually instantiating the underlying structure (which is inefficient in pandas/numpy) Returns ------- Time node """ if PY2: raise ValueError("time su...
[ "def", "_timestamp_time", "(", "arg", ")", ":", "if", "PY2", ":", "raise", "ValueError", "(", "\"time support is not enabled on python 2\"", ")", "return", "ops", ".", "Time", "(", "arg", ")", ".", "to_expr", "(", ")" ]
[ 2240, 0 ]
[ 2253, 34 ]
python
en
['en', 'error', 'th']
False
_timestamp_date
(arg)
Return a Date node for a Timestamp We can then perform certain operations on this node w/o actually instantiating the underlying structure (which is inefficient in pandas/numpy) Returns ------- Date node
Return a Date node for a Timestamp We can then perform certain operations on this node w/o actually instantiating the underlying structure (which is inefficient in pandas/numpy)
def _timestamp_date(arg): """ Return a Date node for a Timestamp We can then perform certain operations on this node w/o actually instantiating the underlying structure (which is inefficient in pandas/numpy) Returns ------- Date node """ return ops.Date(arg).to_expr()
[ "def", "_timestamp_date", "(", "arg", ")", ":", "return", "ops", ".", "Date", "(", "arg", ")", ".", "to_expr", "(", ")" ]
[ 2256, 0 ]
[ 2267, 34 ]
python
en
['en', 'error', 'th']
False
_date_truncate
(arg, unit)
Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling. Parameters ---------- unit : string, one of below table 'Y': year 'Q': quarter 'M': month 'W': week 'D': day Returns ------- truncated : date
Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling.
def _date_truncate(arg, unit): """ Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling. Parameters ---------- unit : string, one of below table 'Y': year 'Q': quarter 'M': month 'W': week 'D': day Returns ------- ...
[ "def", "_date_truncate", "(", "arg", ",", "unit", ")", ":", "return", "ops", ".", "DateTruncate", "(", "arg", ",", "unit", ")", ".", "to_expr", "(", ")" ]
[ 2333, 0 ]
[ 2351, 48 ]
python
en
['en', 'error', 'th']
False
between_time
(arg, lower, upper, timezone=None)
Check if the input expr falls between the lower/upper bounds passed. Bounds are inclusive. All arguments must be comparable. Parameters ---------- lower : str, datetime.time upper : str, datetime.time timezone : str, timezone, default None Returns ------- BooleanValue
Check if the input expr falls between the lower/upper bounds passed. Bounds are inclusive. All arguments must be comparable.
def between_time(arg, lower, upper, timezone=None): """Check if the input expr falls between the lower/upper bounds passed. Bounds are inclusive. All arguments must be comparable. Parameters ---------- lower : str, datetime.time upper : str, datetime.time timezone : str, timezone, default N...
[ "def", "between_time", "(", "arg", ",", "lower", ",", "upper", ",", "timezone", "=", "None", ")", ":", "if", "isinstance", "(", "arg", ".", "op", "(", ")", ",", "ops", ".", "Time", ")", ":", "# Here we pull out the first argument to the underlying Time operati...
[ 2460, 0 ]
[ 2489, 23 ]
python
en
['en', 'en', 'en']
True
_time_truncate
(arg, unit)
Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling. Parameters ---------- unit : string, one of below table 'h': hour 'm': minute 's': second 'ms': millisecond 'us': microsecond 'ns': nanosecond Returns ------- ...
Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling.
def _time_truncate(arg, unit): """ Zero out smaller-size units beyond indicated unit. Commonly used for time series resampling. Parameters ---------- unit : string, one of below table 'h': hour 'm': minute 's': second 'ms': millisecond 'us': microsecond 'ns':...
[ "def", "_time_truncate", "(", "arg", ",", "unit", ")", ":", "return", "ops", ".", "TimeTruncate", "(", "arg", ",", "unit", ")", ".", "to_expr", "(", ")" ]
[ 2492, 0 ]
[ 2511, 48 ]
python
en
['en', 'error', 'th']
False
join
(left, right, predicates=(), how='inner')
Perform a relational join between two tables. Does not resolve resulting table schema. Parameters ---------- left : TableExpr right : TableExpr predicates : join expression(s) how : string, default 'inner' - 'inner': inner join - 'left': left join - 'outer': full outer joi...
Perform a relational join between two tables. Does not resolve resulting table schema.
def join(left, right, predicates=(), how='inner'): """Perform a relational join between two tables. Does not resolve resulting table schema. Parameters ---------- left : TableExpr right : TableExpr predicates : join expression(s) how : string, default 'inner' - 'inner': inner join...
[ "def", "join", "(", "left", ",", "right", ",", "predicates", "=", "(", ")", ",", "how", "=", "'inner'", ")", ":", "klass", "=", "_join_classes", "[", "how", ".", "lower", "(", ")", "]", "if", "isinstance", "(", "predicates", ",", "Expr", ")", ":", ...
[ 2592, 0 ]
[ 2619, 23 ]
python
en
['en', 'en', 'en']
True
asof_join
(left, right, predicates=(), by=(), tolerance=None)
Perform an asof join between two tables. Similar to a left join except that the match is done on nearest key rather than equal keys. Optionally, match keys with 'by' before joining with predicates. Parameters ---------- left : TableExpr right : TableExpr predicates : join expression(s) ...
Perform an asof join between two tables. Similar to a left join except that the match is done on nearest key rather than equal keys.
def asof_join(left, right, predicates=(), by=(), tolerance=None): """Perform an asof join between two tables. Similar to a left join except that the match is done on nearest key rather than equal keys. Optionally, match keys with 'by' before joining with predicates. Parameters ---------- left...
[ "def", "asof_join", "(", "left", ",", "right", ",", "predicates", "=", "(", ")", ",", "by", "=", "(", ")", ",", "tolerance", "=", "None", ")", ":", "return", "ops", ".", "AsOfJoin", "(", "left", ",", "right", ",", "predicates", ",", "by", ",", "t...
[ 2622, 0 ]
[ 2643, 73 ]
python
en
['en', 'en', 'en']
True
cross_join
(*tables, **kwargs)
Perform a cross join (cartesian product) amongst a list of tables, with optional set of prefixes to apply to overlapping column names Parameters ---------- tables : ibis.expr.types.TableExpr Returns ------- joined : TableExpr Examples -------- >>> import ibis >>> sche...
Perform a cross join (cartesian product) amongst a list of tables, with optional set of prefixes to apply to overlapping column names
def cross_join(*tables, **kwargs): """ Perform a cross join (cartesian product) amongst a list of tables, with optional set of prefixes to apply to overlapping column names Parameters ---------- tables : ibis.expr.types.TableExpr Returns ------- joined : TableExpr Examples ...
[ "def", "cross_join", "(", "*", "tables", ",", "*", "*", "kwargs", ")", ":", "# TODO(phillipc): Implement prefix keyword argument", "op", "=", "ops", ".", "CrossJoin", "(", "*", "tables", ",", "*", "*", "kwargs", ")", "return", "op", ".", "to_expr", "(", ")...
[ 2646, 0 ]
[ 2713, 23 ]
python
en
['en', 'error', 'th']
False
_table_count
(self)
Returns the computed number of rows in the table expression Returns ------- count : Int64Scalar
Returns the computed number of rows in the table expression
def _table_count(self): """ Returns the computed number of rows in the table expression Returns ------- count : Int64Scalar """ return ops.Count(self, None).to_expr().name('count')
[ "def", "_table_count", "(", "self", ")", ":", "return", "ops", ".", "Count", "(", "self", ",", "None", ")", ".", "to_expr", "(", ")", ".", "name", "(", "'count'", ")" ]
[ 2716, 0 ]
[ 2724, 56 ]
python
en
['en', 'error', 'th']
False
_table_info
(self, buf=None)
Similar to pandas DataFrame.info. Show column names, types, and null counts. Output to stdout by default
Similar to pandas DataFrame.info. Show column names, types, and null counts. Output to stdout by default
def _table_info(self, buf=None): """ Similar to pandas DataFrame.info. Show column names, types, and null counts. Output to stdout by default """ metrics = [self.count().name('nrows')] for col in self.columns: metrics.append(self[col].count().name(col)) metrics = self.aggregate(metr...
[ "def", "_table_info", "(", "self", ",", "buf", "=", "None", ")", ":", "metrics", "=", "[", "self", ".", "count", "(", ")", ".", "name", "(", "'nrows'", ")", "]", "for", "col", "in", "self", ".", "columns", ":", "metrics", ".", "append", "(", "sel...
[ 2727, 0 ]
[ 2744, 27 ]
python
en
['en', 'error', 'th']
False
_table_set_column
(table, name, expr)
Replace an existing column with a new expression Parameters ---------- name : string Column name to replace expr : value expression New data for column Returns ------- set_table : TableExpr New table expression
Replace an existing column with a new expression
def _table_set_column(table, name, expr): """ Replace an existing column with a new expression Parameters ---------- name : string Column name to replace expr : value expression New data for column Returns ------- set_table : TableExpr New table expression """...
[ "def", "_table_set_column", "(", "table", ",", "name", ",", "expr", ")", ":", "expr", "=", "table", ".", "_ensure_expr", "(", "expr", ")", "if", "expr", ".", "_name", "!=", "name", ":", "expr", "=", "expr", ".", "name", "(", "name", ")", "if", "nam...
[ 2747, 0 ]
[ 2779, 39 ]
python
en
['en', 'error', 'th']
False
filter
(table, predicates)
Select rows from table based on boolean expressions Parameters ---------- predicates : boolean array expressions, or list thereof Returns ------- filtered_expr : TableExpr
Select rows from table based on boolean expressions
def filter(table, predicates): """ Select rows from table based on boolean expressions Parameters ---------- predicates : boolean array expressions, or list thereof Returns ------- filtered_expr : TableExpr """ resolved_predicates = _resolve_predicates(table, predicates) re...
[ "def", "filter", "(", "table", ",", "predicates", ")", ":", "resolved_predicates", "=", "_resolve_predicates", "(", "table", ",", "predicates", ")", "return", "_L", ".", "apply_filter", "(", "table", ",", "resolved_predicates", ")" ]
[ 2794, 0 ]
[ 2807, 54 ]
python
en
['en', 'error', 'th']
False
aggregate
(table, metrics=None, by=None, having=None, **kwds)
Aggregate a table with a given set of reductions, with grouping expressions, and post-aggregation filters. Parameters ---------- table : table expression metrics : expression or expression list by : optional, default None Grouping expressions having : optional, default None ...
Aggregate a table with a given set of reductions, with grouping expressions, and post-aggregation filters.
def aggregate(table, metrics=None, by=None, having=None, **kwds): """ Aggregate a table with a given set of reductions, with grouping expressions, and post-aggregation filters. Parameters ---------- table : table expression metrics : expression or expression list by : optional, default ...
[ "def", "aggregate", "(", "table", ",", "metrics", "=", "None", ",", "by", "=", "None", ",", "having", "=", "None", ",", "*", "*", "kwds", ")", ":", "if", "metrics", "is", "None", ":", "metrics", "=", "[", "]", "for", "k", ",", "v", "in", "sorte...
[ 2824, 0 ]
[ 2850, 23 ]
python
en
['en', 'error', 'th']
False
_table_distinct
(self)
Compute set of unique rows/tuples occurring in this table
Compute set of unique rows/tuples occurring in this table
def _table_distinct(self): """ Compute set of unique rows/tuples occurring in this table """ op = ops.Distinct(self) return op.to_expr()
[ "def", "_table_distinct", "(", "self", ")", ":", "op", "=", "ops", ".", "Distinct", "(", "self", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 2853, 0 ]
[ 2858, 23 ]
python
en
['en', 'error', 'th']
False
_table_limit
(table, n, offset=0)
Select the first n rows at beginning of table (may not be deterministic depending on implementation and presence of a sorting). Parameters ---------- n : int Number of rows to include offset : int, default 0 Number of rows to skip first Returns ------- limited : TableE...
Select the first n rows at beginning of table (may not be deterministic depending on implementation and presence of a sorting).
def _table_limit(table, n, offset=0): """ Select the first n rows at beginning of table (may not be deterministic depending on implementation and presence of a sorting). Parameters ---------- n : int Number of rows to include offset : int, default 0 Number of rows to skip first ...
[ "def", "_table_limit", "(", "table", ",", "n", ",", "offset", "=", "0", ")", ":", "op", "=", "ops", ".", "Limit", "(", "table", ",", "n", ",", "offset", "=", "offset", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 2861, 0 ]
[ 2878, 23 ]
python
en
['en', 'error', 'th']
False
_head
(table, n=5)
Select the first n rows at beginning of a table (may not be deterministic depending on implementation and presence of a sorting). Parameters ---------- n : int Number of rows to include, defaults to 5 Returns ------- limited : TableExpr See Also -------- ibis.expr.t...
Select the first n rows at beginning of a table (may not be deterministic depending on implementation and presence of a sorting).
def _head(table, n=5): """ Select the first n rows at beginning of a table (may not be deterministic depending on implementation and presence of a sorting). Parameters ---------- n : int Number of rows to include, defaults to 5 Returns ------- limited : TableExpr See Als...
[ "def", "_head", "(", "table", ",", "n", "=", "5", ")", ":", "return", "_table_limit", "(", "table", ",", "n", "=", "n", ")" ]
[ 2881, 0 ]
[ 2899, 35 ]
python
en
['en', 'error', 'th']
False
_table_sort_by
(table, sort_exprs)
Sort table by the indicated column expressions and sort orders (ascending/descending) Parameters ---------- sort_exprs : sorting expressions Must be one of: - Column name or expression - Sort key, e.g. desc(col) - (column name, True (ascending) / False (descending)) ...
Sort table by the indicated column expressions and sort orders (ascending/descending)
def _table_sort_by(table, sort_exprs): """ Sort table by the indicated column expressions and sort orders (ascending/descending) Parameters ---------- sort_exprs : sorting expressions Must be one of: - Column name or expression - Sort key, e.g. desc(col) - (column ...
[ "def", "_table_sort_by", "(", "table", ",", "sort_exprs", ")", ":", "result", "=", "table", ".", "op", "(", ")", ".", "sort_by", "(", "table", ",", "sort_exprs", ")", "return", "result", ".", "to_expr", "(", ")" ]
[ 2902, 0 ]
[ 2926, 27 ]
python
en
['en', 'error', 'th']
False
_table_union
(left, right, distinct=False)
Form the table set union of two table expressions having identical schemas. Parameters ---------- right : TableExpr distinct : boolean, default False Only union distinct rows not occurring in the calling table (this can be very expensive, be careful) Returns ------- ...
Form the table set union of two table expressions having identical schemas.
def _table_union(left, right, distinct=False): """ Form the table set union of two table expressions having identical schemas. Parameters ---------- right : TableExpr distinct : boolean, default False Only union distinct rows not occurring in the calling table (this can be v...
[ "def", "_table_union", "(", "left", ",", "right", ",", "distinct", "=", "False", ")", ":", "op", "=", "ops", ".", "Union", "(", "left", ",", "right", ",", "distinct", "=", "distinct", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 2929, 0 ]
[ 2946, 23 ]
python
en
['en', 'error', 'th']
False
_table_to_array
(self)
Single column tables can be viewed as arrays.
Single column tables can be viewed as arrays.
def _table_to_array(self): """ Single column tables can be viewed as arrays. """ op = ops.TableArrayView(self) return op.to_expr()
[ "def", "_table_to_array", "(", "self", ")", ":", "op", "=", "ops", ".", "TableArrayView", "(", "self", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 2949, 0 ]
[ 2954, 23 ]
python
en
['en', 'error', 'th']
False
_table_materialize
(table)
Force schema resolution for a joined table, selecting all fields from all tables.
Force schema resolution for a joined table, selecting all fields from all tables.
def _table_materialize(table): """ Force schema resolution for a joined table, selecting all fields from all tables. """ if table._is_materialized(): return table op = ops.MaterializedJoin(table) return op.to_expr()
[ "def", "_table_materialize", "(", "table", ")", ":", "if", "table", ".", "_is_materialized", "(", ")", ":", "return", "table", "op", "=", "ops", ".", "MaterializedJoin", "(", "table", ")", "return", "op", ".", "to_expr", "(", ")" ]
[ 2957, 0 ]
[ 2966, 23 ]
python
en
['en', 'error', 'th']
False
add_column
(table, expr, name=None)
Add indicated column expression to table, producing a new table. Note: this is a shortcut for performing a projection having the same effect. Returns ------- modified_table : TableExpr
Add indicated column expression to table, producing a new table. Note: this is a shortcut for performing a projection having the same effect.
def add_column(table, expr, name=None): """ Add indicated column expression to table, producing a new table. Note: this is a shortcut for performing a projection having the same effect. Returns ------- modified_table : TableExpr """ warnings.warn('add_column is deprecated, use mutate(na...
[ "def", "add_column", "(", "table", ",", "expr", ",", "name", "=", "None", ")", ":", "warnings", ".", "warn", "(", "'add_column is deprecated, use mutate(name=expr, ...)'", ",", "DeprecationWarning", ")", "if", "name", "is", "not", "None", ":", "return", "table",...
[ 2969, 0 ]
[ 2983, 33 ]
python
en
['en', 'error', 'th']
False
mutate
(table, exprs=None, **mutations)
Convenience function for table projections involving adding columns Parameters ---------- exprs : list, default None List of named expressions to add as columns mutations : keywords for new columns Returns ------- mutated : TableExpr Examples -------- Using keywords...
Convenience function for table projections involving adding columns
def mutate(table, exprs=None, **mutations): """ Convenience function for table projections involving adding columns Parameters ---------- exprs : list, default None List of named expressions to add as columns mutations : keywords for new columns Returns ------- mutated : Tabl...
[ "def", "mutate", "(", "table", ",", "exprs", "=", "None", ",", "*", "*", "mutations", ")", ":", "if", "exprs", "is", "None", ":", "exprs", "=", "[", "]", "else", ":", "exprs", "=", "util", ".", "promote_list", "(", "exprs", ")", "for", "k", ",", ...
[ 2993, 0 ]
[ 3082, 48 ]
python
en
['en', 'error', 'th']
False
projection
(table, exprs)
Compute new table expression with the indicated column expressions from this table. Parameters ---------- exprs : column expression, or string, or list of column expressions and strings. If strings passed, must be columns in the table already Returns ------- projection : TableEx...
Compute new table expression with the indicated column expressions from this table.
def projection(table, exprs): """ Compute new table expression with the indicated column expressions from this table. Parameters ---------- exprs : column expression, or string, or list of column expressions and strings. If strings passed, must be columns in the table already Returns...
[ "def", "projection", "(", "table", ",", "exprs", ")", ":", "import", "ibis", ".", "expr", ".", "analysis", "as", "L", "if", "isinstance", "(", "exprs", ",", "(", "Expr", ",", ")", "+", "six", ".", "string_types", ")", ":", "exprs", "=", "[", "exprs...
[ 3085, 0 ]
[ 3185, 23 ]
python
en
['en', 'error', 'th']
False
_table_relabel
(table, substitutions, replacements=None)
Change table column names, otherwise leaving table unaltered Parameters ---------- substitutions Returns ------- relabeled : TableExpr
Change table column names, otherwise leaving table unaltered
def _table_relabel(table, substitutions, replacements=None): """ Change table column names, otherwise leaving table unaltered Parameters ---------- substitutions Returns ------- relabeled : TableExpr """ if replacements is not None: raise NotImplementedError observ...
[ "def", "_table_relabel", "(", "table", ",", "substitutions", ",", "replacements", "=", "None", ")", ":", "if", "replacements", "is", "not", "None", ":", "raise", "NotImplementedError", "observed", "=", "set", "(", ")", "exprs", "=", "[", "]", "for", "c", ...
[ 3188, 0 ]
[ 3217, 34 ]
python
en
['en', 'error', 'th']
False
_table_view
(self)
Create a new table expression that is semantically equivalent to the current one, but is considered a distinct relation for evaluation purposes (e.g. in SQL). For doing any self-referencing operations, like a self-join, you will use this operation to create a reference to the current table exp...
Create a new table expression that is semantically equivalent to the current one, but is considered a distinct relation for evaluation purposes (e.g. in SQL).
def _table_view(self): """ Create a new table expression that is semantically equivalent to the current one, but is considered a distinct relation for evaluation purposes (e.g. in SQL). For doing any self-referencing operations, like a self-join, you will use this operation to create a referenc...
[ "def", "_table_view", "(", "self", ")", ":", "new_view", "=", "ops", ".", "SelfReference", "(", "self", ")", "return", "new_view", ".", "to_expr", "(", ")" ]
[ 3220, 0 ]
[ 3235, 29 ]
python
en
['en', 'error', 'th']
False
prevent_rewrite
(expr, client=None)
Prevent optimization from happening below `expr`. Parameters ---------- expr : ir.TableExpr Any table expression whose optimization you want to prevent client : ibis.client.Client, optional, default None A client to use to create the SQLQueryResult operation. This is useful if y...
Prevent optimization from happening below `expr`.
def prevent_rewrite(expr, client=None): """Prevent optimization from happening below `expr`. Parameters ---------- expr : ir.TableExpr Any table expression whose optimization you want to prevent client : ibis.client.Client, optional, default None A client to use to create the SQLQue...
[ "def", "prevent_rewrite", "(", "expr", ",", "client", "=", "None", ")", ":", "if", "client", "is", "None", ":", "client", ",", "=", "ibis", ".", "client", ".", "find_backends", "(", "expr", ")", "query", "=", "client", ".", "compile", "(", "expr", ")...
[ 3293, 0 ]
[ 3312, 69 ]
python
en
['en', 'en', 'en']
True
privileges_granted_directly
(self, node=None)
Check that a user is able to execute `ALTER ROLE` with privileges are granted directly.
Check that a user is able to execute `ALTER ROLE` with privileges are granted directly.
def privileges_granted_directly(self, node=None): """Check that a user is able to execute `ALTER ROLE` with privileges are granted directly. """ user_name = f"user_{getuid()}" if node is None: node = self.context.node with user(node, f"{user_name}"): Suite(run=alter_role, ...
[ "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_...
[ 8, 0 ]
[ 22, 74 ]
python
en
['en', 'en', 'en']
True
privileges_granted_via_role
(self, node=None)
Check that a user is able to execute `ALTER ROLE` with privileges are granted through a role.
Check that a user is able to execute `ALTER ROLE` with privileges are granted through a role.
def privileges_granted_via_role(self, node=None): """Check that a user is able to execute `ALTER ROLE` with privileges are 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", "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"...
[ 25, 0 ]
[ 43, 74 ]
python
en
['en', 'en', 'en']
True
alter_role
(self, privilege, grant_target_name, user_name, node=None)
Check that user is only able to execute `ALTER ROLE` when they have the necessary privilege.
Check that user is only able to execute `ALTER ROLE` when they have the necessary privilege.
def alter_role(self, privilege, grant_target_name, user_name, node=None): """Check that user is only able to execute `ALTER ROLE` when they have the necessary privilege. """ exitcode, message = errors.not_enough_privileges(name=user_name) if node is None: node = self.context.node with Scen...
[ "def", "alter_role", "(", "self", ",", "privilege", ",", "grant_target_name", ",", "user_name", ",", "node", "=", "None", ")", ":", "exitcode", ",", "message", "=", "errors", ".", "not_enough_privileges", "(", "name", "=", "user_name", ")", "if", "node", "...
[ 51, 0 ]
[ 114, 55 ]
python
en
['en', 'en', 'en']
True
feature
(self, node="clickhouse1")
Check the RBAC functionality of ALTER ROLE.
Check the RBAC functionality of ALTER ROLE.
def feature(self, node="clickhouse1"): """Check the RBAC functionality of ALTER ROLE. """ 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_log)
[ "def", "feature", "(", "self", ",", "node", "=", "\"clickhouse1\"", ")", ":", "self", ".", "context", ".", "node", "=", "self", ".", "context", ".", "cluster", ".", "node", "(", "node", ")", "Suite", "(", "run", "=", "privileges_granted_directly", ",", ...
[ 123, 0 ]
[ 129, 82 ]
python
en
['en', 'en', 'en']
True
replicated_privileges_granted_directly
(self, node=None)
Check that a user is able to execute `SYSTEM REPLICATED SENDS` commands if and only if the privilege has been granted directly.
Check that a user is able to execute `SYSTEM REPLICATED SENDS` commands if and only if the privilege has been granted directly.
def replicated_privileges_granted_directly(self, node=None): """Check that a user is able to execute `SYSTEM REPLICATED SENDS` commands if and only if the privilege has been granted directly. """ user_name = f"user_{getuid()}" if node is None: node = self.context.node with user(node, f...
[ "def", "replicated_privileges_granted_directly", "(", "self", ",", "node", "=", "None", ")", ":", "user_name", "=", "f\"user_{getuid()}\"", "if", "node", "is", "None", ":", "node", "=", "self", ".", "context", ".", "node", "with", "user", "(", "node", ",", ...
[ 8, 0 ]
[ 22, 80 ]
python
en
['en', 'en', 'en']
True