I created one function for create expression
def test(operator1, operation, operator2):
return literal_column(operator1).op(operation)(operator2)
Now when I call it with
test(1, '=', 1)
then it works
But when I pass
test('abc', '=', 'abc')
Then it gives error that abc is not a column.
I tried to convert it
def test(operator1, operation, operator2):
return literal_column(operator1, String).op(operation)(operator2)
But that was not working.
This will work if i call with
test("'abc'", '=', 'abc')
Is there any way, to get the type of operator1 and on that bases we can create literal_colum which will be map to same type of content ?