class Substring(ValueOp): input_type = [ string, integer(name='start'), integer(name='length', optional=True) ] output_type = rules.shape_like_arg(0, 'string')
class BaseConvert(ValueOp): input_type = [ rules.one_of([integer, string]), integer(name='from_base'), integer(name='to_base') ] output_type = rules.shape_like_flatargs('string')
class StringFind(ValueOp): input_type = [ string, string(name='substr'), integer(name='start', optional=True, default=None), integer(name='end', optional=True, default=None) ] output_type = rules.shape_like_arg(0, 'int64')
class MyOp(ops.ValueOp): input_type = [ rules.list_of( rules.integer(as_value_expr=custom_as_value_expr), name='bar', ) ]
class ShiftBase(AnalyticOp): input_type = [ rules.array, rules.integer(name='offset', optional=True), rules.value(name='default', optional=True) ] output_type = rules.type_of_arg(0)
class RPad(ValueOp): input_type = [ string, integer(name='length'), string(name='pad', optional=True) ] output_type = rules.shape_like_arg(0, 'string')
class Round(ValueOp): input_type = [value, integer(name='digits', optional=True)] def output_type(self): arg, digits = self.args if isinstance(arg, ir.DecimalValue): return arg._factory elif digits is None: return rules.shape_like(arg, 'int64') else: return rules.shape_like(arg, 'double')
class RegexExtract(ValueOp): input_type = [string, string(name='pattern'), integer(name='index')] output_type = rules.shape_like_arg(0, 'string')
class Repeat(ValueOp): input_type = [string, integer(name='times')] output_type = rules.shape_like_arg(0, 'string')
class StrRight(ValueOp): input_type = [string, integer(name='nchars')] output_type = rules.shape_like_arg(0, 'string')
class MyOp(ops.ValueOp): input_type = [rules.integer(name='foo', doc=doc)] def output_type(self): return MyExpr