Skip to content

Commit 209069f

Browse files
authored
Add SystemPython3_8 to SystemPython3_13 to YQL (#3877)
1 parent d4d7c90 commit 209069f

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

ydb/library/yql/minikql/mkql_function_registry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class TMutableFunctionRegistry: public IMutableFunctionRegistry
159159
if (!abiVersionFunc) {
160160
return;
161161
}
162-
162+
163163
ui32 version = abiVersionFunc();
164164
Y_ENSURE(NUdf::IsAbiCompatible(version) && version >= NUdf::MakeAbiVersion(2, 8, 0),
165165
"Non compatible ABI version of UDF library " << libraryPath

ydb/library/yql/minikql/mkql_program_builder.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ void EnsureScriptSpecificTypes(
8484
case EScriptType::CustomPython:
8585
case EScriptType::CustomPython2:
8686
case EScriptType::CustomPython3:
87+
case EScriptType::SystemPython2:
88+
case EScriptType::SystemPython3:
89+
case EScriptType::SystemPython3_8:
90+
case EScriptType::SystemPython3_9:
91+
case EScriptType::SystemPython3_10:
92+
case EScriptType::SystemPython3_11:
93+
case EScriptType::SystemPython3_12:
94+
case EScriptType::SystemPython3_13:
8795
return TPythonTypeChecker().Walk(funcType, env);
8896
case EScriptType::Javascript:
8997
return TJavascriptTypeChecker().Walk(funcType, env);
@@ -301,6 +309,12 @@ bool IsCustomPython(EScriptType type) {
301309
bool IsSystemPython(EScriptType type) {
302310
return type == EScriptType::SystemPython2
303311
|| type == EScriptType::SystemPython3
312+
|| type == EScriptType::SystemPython3_8
313+
|| type == EScriptType::SystemPython3_9
314+
|| type == EScriptType::SystemPython3_10
315+
|| type == EScriptType::SystemPython3_11
316+
|| type == EScriptType::SystemPython3_12
317+
|| type == EScriptType::SystemPython3_13
304318
|| type == EScriptType::Python
305319
|| type == EScriptType::Python2;
306320
}

ydb/library/yql/minikql/mkql_program_builder.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ inline bool HasSpillingFlag(const TCallable& callable) {
105105
xx(CustomPython3, 11, custompython3, true) \
106106
xx(SystemPython2, 12, systempython2, false) \
107107
xx(SystemPython3, 13, systempython3, false) \
108+
xx(SystemPython3_8, 14, systempython3_8, false) \
109+
xx(SystemPython3_9, 15, systempython3_9, false) \
110+
xx(SystemPython3_10, 16, systempython3_10, false) \
111+
xx(SystemPython3_11, 17, systempython3_11, false) \
112+
xx(SystemPython3_12, 18, systempython3_12, false) \
113+
xx(SystemPython3_13, 19, systempython3_13, false) \
108114

109115
enum class EScriptType {
110116
MKQL_SCRIPT_TYPES(ENUM_VALUE_GEN)

ydb/library/yql/yt/native/plugin.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,12 @@ class TYqlPlugin
267267
if (path.EndsWith("libyqlplugin.so")) {
268268
continue;
269269
}
270-
FuncRegistry_->LoadUdfs(path, emptyRemappings, 0);
270+
ui32 flags = 0;
271+
// System Python UDFs are not used locally so we only need types.
272+
if (path.Contains("systempython") && path.Contains(TString("udf") + MKQL_UDF_LIB_SUFFIX)) {
273+
flags |= NUdf::IRegistrator::TFlags::TypesOnly;
274+
}
275+
FuncRegistry_->LoadUdfs(path, emptyRemappings, flags);
271276
if (DqManagerConfig_) {
272277
DqManagerConfig_->UdfsWithMd5.emplace(path, MD5::File(path));
273278
}

0 commit comments

Comments
 (0)