MCPcopy Create free account
hub / github.com/apache/impala / create_from_args

Method create_from_args

tests/comparison/funcs.py:145–160  ·  view source on GitHub ↗

Constructor for instantiating from values. The return types of the exprs will be inspected and used to find the function signature. If no signature can be found an error will be raised.

(cls, *val_exprs)

Source from the content-addressed store, hash-verified

143
144 @classmethod
145 def create_from_args(cls, *val_exprs):
146 '''Constructor for instantiating from values. The return types of the exprs will be
147 inspected and used to find the function signature. If no signature can be found
148 an error will be raised.
149 '''
150 for signature in cls.signatures():
151 if len(signature.args) != len(val_exprs):
152 continue
153 for idx, arg in enumerate(val_exprs):
154 if not issubclass(arg.type, signature.args[idx].type):
155 break
156 else:
157 break
158 else:
159 raise Exception('No signature matches the given arguments: %s' % (val_exprs, ))
160 return cls(signature, *val_exprs)
161
162 def __init__(self, signature, *val_exprs):
163 '''"signature" should be one of the available signatures at the class level and

Callers 9

flatten_join_clauseMethod · 0.80
flatten_from_clauseMethod · 0.80
create_join_predicateMethod · 0.80
_create_join_clauseMethod · 0.80
FakeFirstValueFunction · 0.80

Calls 1

signaturesMethod · 0.80

Tested by 1