1. Michael Bayer
  2. sqlalchemy
  3. Issues


Issue #2850 resolved

cleanly upgrade the type of bindparam() with a null type

Michael Bayer
repo owner created an issue
        bp = bindparam("somevalue")
        stmt = test_table.update().values(avalue=bp)
        compiled = stmt.compile()
        eq_(bp.type._type_affinity, types.NullType)
        eq_(compiled.binds['somevalue']('somevalue').type._type_affinity, MyCustomType)

# additionally:

        bp = bindparam("foo")
        expr = column("foo", MyFoobarType) + bp
        assert bp.type._type_affinity is types.NullType
        assert expr.right.type._type_affinity is MyFoobarType

Comments (3)

  1. Log in to comment