diff --git a/ydb/library/yql/udfs/common/python/bindings/py_cast_ut.cpp b/ydb/library/yql/udfs/common/python/bindings/py_cast_ut.cpp index a58bd6ec25eb..47f65ab6fabd 100644 --- a/ydb/library/yql/udfs/common/python/bindings/py_cast_ut.cpp +++ b/ydb/library/yql/udfs/common/python/bindings/py_cast_ut.cpp @@ -68,17 +68,23 @@ Y_UNIT_TEST_SUITE(TPyCastTest) { yexception, "Cast error object '3 1415926' to Float"); } +#if PY_MAJOR_VERSION >= 3 +# define RETVAL "-1" +#else +# define RETVAL "-18446744073709551616L" +#endif + Y_UNIT_TEST(BadFromPythonLong) { TPythonTestEngine engine; UNIT_ASSERT_EXCEPTION_CONTAINS( engine.ToMiniKQL( "def Test():\n" - " return -1", + " return " RETVAL, [](const NUdf::TUnboxedValuePod& value) { Y_UNUSED(value); Y_UNREACHABLE(); }), - yexception, "Cast error object -1 to Long"); + yexception, "Cast error object " RETVAL " to Long"); } }