aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsinister <sinister@yandex-team.ru>2022-02-10 16:50:50 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:50 +0300
commiteace2adfb451fa3978f6edbae8aec53a50d1c969 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /build
parentb76c7a19e20d232ef1e00ccbe68f64a3024d29ed (diff)
downloadydb-eace2adfb451fa3978f6edbae8aec53a50d1c969.tar.gz
Restoring authorship annotation for <sinister@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'build')
-rw-r--r--build/plugins/yql_python_udf.py24
-rw-r--r--build/scripts/gen_yql_python_udf.py50
2 files changed, 37 insertions, 37 deletions
diff --git a/build/plugins/yql_python_udf.py b/build/plugins/yql_python_udf.py
index 324821c3bf..c4f949d8a9 100644
--- a/build/plugins/yql_python_udf.py
+++ b/build/plugins/yql_python_udf.py
@@ -8,11 +8,11 @@ def get_or_default(kv, name, default):
def onregister_yql_python_udf(unit, *args):
- flat, kv = sort_by_keywords({'NAME': 1, 'RESOURCE_NAME': 1, 'ADD_LIBRA_MODULES': 1}, args)
+ flat, kv = sort_by_keywords({'NAME': 1, 'RESOURCE_NAME': 1, 'ADD_LIBRA_MODULES': 1}, args)
assert len(flat) == 0
name = get_or_default(kv, 'NAME', 'CustomPython')
resource_name = get_or_default(kv, 'RESOURCE_NAME', name)
- add_libra_modules = get_or_default(kv, 'ADD_LIBRA_MODULES', 'no') == 'yes'
+ add_libra_modules = get_or_default(kv, 'ADD_LIBRA_MODULES', 'no') == 'yes'
use_arcadia_python = unit.get('USE_ARCADIA_PYTHON') == 'yes'
py3 = unit.get('PYTHON3') == 'yes'
@@ -21,10 +21,10 @@ def onregister_yql_python_udf(unit, *args):
unit.onpeerdir(['yql/udfs/common/python/python_udf'])
unit.onpeerdir(['ydb/library/yql/public/udf'])
- if add_libra_modules:
- unit.onpeerdir(['quality/user_sessions/libra_arc/noyql'])
- unit.onpeerdir(['yql/udfs/quality/libra/module'])
-
+ if add_libra_modules:
+ unit.onpeerdir(['quality/user_sessions/libra_arc/noyql'])
+ unit.onpeerdir(['yql/udfs/quality/libra/module'])
+
if use_arcadia_python:
flavor = 'Arcadia'
unit.onpeerdir([
@@ -32,7 +32,7 @@ def onregister_yql_python_udf(unit, *args):
'yql/udfs/common/python/main'
] if not py3 else [
'library/python/runtime_py3',
- 'yql/udfs/common/python/main_py3'
+ 'yql/udfs/common/python/main_py3'
])
else:
flavor = 'System'
@@ -41,14 +41,14 @@ def onregister_yql_python_udf(unit, *args):
'yql/udfs/common/python/python_udf/python_udf.h',
'ydb/library/yql/public/udf/udf_registrator.h',
]
- if add_libra_modules:
- output_includes.append('yql/udfs/quality/libra/module/module.h')
-
+ if add_libra_modules:
+ output_includes.append('yql/udfs/quality/libra/module/module.h')
+
path = name + '.yql_python_udf.cpp'
- libra_flag = '1' if add_libra_modules else '0'
+ libra_flag = '1' if add_libra_modules else '0'
unit.onpython([
'build/scripts/gen_yql_python_udf.py',
- flavor, name, resource_name, path, libra_flag,
+ flavor, name, resource_name, path, libra_flag,
'OUT', path,
'OUTPUT_INCLUDES',
] + output_includes
diff --git a/build/scripts/gen_yql_python_udf.py b/build/scripts/gen_yql_python_udf.py
index e2dd7cc9e0..13b5898117 100644
--- a/build/scripts/gen_yql_python_udf.py
+++ b/build/scripts/gen_yql_python_udf.py
@@ -5,40 +5,40 @@ TEMPLATE="""
#include <ydb/library/yql/public/udf/udf_registrator.h>
-#if @WITH_LIBRA@
-#include <yql/udfs/quality/libra/module/module.h>
-#endif
-
+#if @WITH_LIBRA@
+#include <yql/udfs/quality/libra/module/module.h>
+#endif
+
using namespace NKikimr::NUdf;
#ifdef BUILD_UDF
-#if @WITH_LIBRA@
-LIBRA_MODULE(TLibraModule, "Libra@MODULE_NAME@");
-#endif
-
-extern "C" UDF_API void Register(IRegistrator& registrator, ui32 flags) {
+#if @WITH_LIBRA@
+LIBRA_MODULE(TLibraModule, "Libra@MODULE_NAME@");
+#endif
+
+extern "C" UDF_API void Register(IRegistrator& registrator, ui32 flags) {
RegisterYqlPythonUdf(registrator, flags, TStringBuf("@MODULE_NAME@"), TStringBuf("@PACKAGE_NAME@"), EPythonFlavor::@FLAVOR@);
-#if @WITH_LIBRA@
- RegisterHelper<TLibraModule>(registrator);
-#endif
-}
-
-extern "C" UDF_API ui32 AbiVersion() {
- return CurrentAbiVersion();
-}
-
-extern "C" UDF_API void SetBackTraceCallback(TBackTraceCallback callback) {
- SetBackTraceCallbackImpl(callback);
-}
-
+#if @WITH_LIBRA@
+ RegisterHelper<TLibraModule>(registrator);
+#endif
+}
+
+extern "C" UDF_API ui32 AbiVersion() {
+ return CurrentAbiVersion();
+}
+
+extern "C" UDF_API void SetBackTraceCallback(TBackTraceCallback callback) {
+ SetBackTraceCallbackImpl(callback);
+}
+
#endif
"""
def main():
- assert len(sys.argv) == 6
- flavor, module_name, package_name, path, libra_flag = sys.argv[1:]
+ assert len(sys.argv) == 6
+ flavor, module_name, package_name, path, libra_flag = sys.argv[1:]
with open(path, 'w') as f:
f.write(
TEMPLATE
@@ -46,7 +46,7 @@ def main():
.replace('@MODULE_NAME@', module_name)
.replace('@PACKAGE_NAME@', package_name)
.replace('@FLAVOR@', flavor)
- .replace('@WITH_LIBRA@', libra_flag)
+ .replace('@WITH_LIBRA@', libra_flag)
)
f.write('\n')