Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def do(self, a):
Guard.against_empty(a, "Argument a is required")
pass
def __init__(self, a):
Guard.against_empty(a, "Argument a is required")
pass
def select(self, *cols):
empty_message = "Selecting with no fields is not valid. " \
+ "When using From(provider).select method, " \
+ "please provide a list of expressions or strings as fields."
Guard.against_empty(cols, empty_message)
for col in cols:
Guard.against_empty(col, empty_message)
Guard.accepts_only(cols, [str, Expression], "Selecting with invalid type. " \
+ "When using From(provider).select method, " \
+ "please provide a list of expressions or strings as fields.")
return self.provider.parse(self, action=Actions.Select, cols=cols)
def __init__(self, node_type, lhs, rhs):
'''Initializes the BinaryExpression with the specified arguments.
Arguments:
node_type - Specifies the type of operation that this BinaryExpression represents
lhs - Left-hand side of the operation (as in the first argument)
rhs - Right-hand site of the operation (as in the second argument)
'''
Guard.against_empty(node_type, "The BinaryExpression node type is required")
Guard.accepts(lhs, (Expression,), "Lhs must be an expression (an instance of a class that inherits from pynq.Expression), but was %s" % lhs.__class__.__name__)
Guard.accepts(rhs, (Expression,), "Rhs must be an expression (an instance of a class that inherits from pynq.Expression) but was %s" % rhs.__class__.__name__)
self.node_type = node_type
self.lhs = lhs
self.rhs = rhs
def select(self, *cols):
empty_message = "Selecting with no fields is not valid. " \
+ "When using From(provider).select method, " \
+ "please provide a list of expressions or strings as fields."
Guard.against_empty(cols, empty_message)
for col in cols:
Guard.against_empty(col, empty_message)
Guard.accepts_only(cols, [str, Expression], "Selecting with invalid type. " \
+ "When using From(provider).select method, " \
+ "please provide a list of expressions or strings as fields.")
return self.provider.parse(self, action=Actions.Select, cols=cols)