Skip to content

Commit

Permalink
YQL-18463: Adjust BadFromPythonLong for Python 2.x (#4812)
Browse files Browse the repository at this point in the history
  • Loading branch information
igormunkin committed May 24, 2024
1 parent 9529d2c commit d25e35f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ydb/library/yql/udfs/common/python/bindings/py_cast_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,23 @@ Y_UNIT_TEST_SUITE(TPyCastTest) {
yexception, "Cast error object '3 <dot> 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<ui64>(
"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");
}

}

0 comments on commit d25e35f

Please sign in to comment.