OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableFunctionsFactory_transformers.RangeAnnotationTransformer Class Reference
+ Inheritance diagram for TableFunctionsFactory_transformers.RangeAnnotationTransformer:
+ Collaboration diagram for TableFunctionsFactory_transformers.RangeAnnotationTransformer:

Public Member Functions

def visit_arg_node
 
- Public Member Functions inherited from TableFunctionsFactory_transformers.AstTransformer
def visit_udtf_node
 
def visit_composed_node
 
def visit_arg_node
 
def visit_primitive_node
 
def visit_template_node
 
def visit_annotation_node
 
- Public Member Functions inherited from TableFunctionsFactory_transformers.AstVisitor
def visit_udtf_node
 
def visit_composed_node
 
def visit_arg_node
 
def visit_primitive_node
 
def visit_annotation_node
 
def visit_template_node
 

Detailed Description

* Append require annotation if range is used

Definition at line 430 of file TableFunctionsFactory_transformers.py.

Member Function Documentation

def TableFunctionsFactory_transformers.RangeAnnotationTransformer.visit_arg_node (   self,
  arg_node 
)

Definition at line 434 of file TableFunctionsFactory_transformers.py.

435  def visit_arg_node(self, arg_node):
436  for ann in arg_node.annotations:
437  if ann.key == 'range':
438  name = arg_node.get_annotation('name')
439  if name is None:
440  raise TransformerException('"range" requires a named argument')
441 
442  v = ann.value
443  if len(v) == 2:
444  lo, hi = ann.value
445  value = '"{lo} <= {name} && {name} <= {hi}"'.format(lo=lo, hi=hi, name=name)
446  else:
447  raise TransformerException('"range" requires an interval. Got {v}'.format(v=v))
448  arg_node.set_annotation('require', value)
449  return arg_node
450 

The documentation for this class was generated from the following file: