diff --git a/kubeflow/core/tests/util_test.jsonnet b/kubeflow/core/tests/util_test.jsonnet index 8fc7f6b3a69..6509d063245 100644 --- a/kubeflow/core/tests/util_test.jsonnet +++ b/kubeflow/core/tests/util_test.jsonnet @@ -1,9 +1,5 @@ local util = import "../util.libsonnet"; -std.assertEqual(util.upper("True"), "TRUE") && -std.assertEqual(util.upper("TrUe"), "TRUE") && -std.assertEqual(util.upper("true"), "TRUE") && -std.assertEqual(util.upper("TRUE"), "TRUE") && std.assertEqual(util.lower("aTruez"), "atruez") && std.assertEqual(util.lower("ATrUez"), "atruez") && std.assertEqual(util.lower("atruez"), "atruez") && @@ -25,8 +21,6 @@ std.assertEqual(util.toArray("ca, or,fl, mo"), ["ca", "or", "fl", "mo"]) && std.assertEqual(std.length(util.toArray(2)), 0) && std.assertEqual(std.length(util.toArray("hello world")), 1) && std.assertEqual(std.length(util.toArray([1, 2, 3, 4])), 0) && -std.assertEqual(util.isUpper(std.substr("Hi", 0, 1)), true) && -std.assertEqual(util.isUpper(std.substr("lo", 0, 1)), false) && std.assertEqual(util.sort(["Craydad", "CCall", "crayon"]), ["CCall", "Craydad", "crayon"]) && std.assertEqual( { diff --git a/kubeflow/core/util.libsonnet b/kubeflow/core/util.libsonnet index a41fa9b04ba..0ecb872345f 100644 --- a/kubeflow/core/util.libsonnet +++ b/kubeflow/core/util.libsonnet @@ -3,26 +3,6 @@ local k = import "k.libsonnet", local util = self, - // Is the character upper case? - isUpper:: function(c) { - local cp = std.codepoint, - local value = if cp(c) >= 65 && cp(c) < 91 then - true - else - false, - result:: value, - }.result, - - // TODO(https://github.com/kubeflow/kubeflow/issues/1826): Replace with std.asciiUpper once supported by required version of jsonnet - // Convert a string to upper case. - upper:: function(x) { - local cp(c) = std.codepoint(c), - local upperLetter(c) = if cp(c) >= 97 && cp(c) < 123 then - std.char(cp(c) - 32) - else c, - result:: std.join("", std.map(upperLetter, std.stringChars(x))), - }.result, - // Convert a string to lower case. lower:: function(x) { local cp(c) = std.codepoint(c), @@ -39,7 +19,7 @@ if std.type(x) == "boolean" then x else if std.type(x) == "string" then - $.upper(x) == "TRUE" + std.asciiUpper(x) == "TRUE" else if std.type(x) == "number" then x != 0 else diff --git a/kubeflow/openmpi/util.libsonnet b/kubeflow/openmpi/util.libsonnet index a597e8468a9..2f1cd7527a7 100644 --- a/kubeflow/openmpi/util.libsonnet +++ b/kubeflow/openmpi/util.libsonnet @@ -15,16 +15,6 @@ for keyValue in $.toArray(str) } else {}, - // TODO(https://github.com/kubeflow/kubeflow/issues/1826): Replace with std.asciiUpper once supported by required version of jsonnet - // Convert a string to upper case. - upper:: function(x) { - local cp(c) = std.codepoint(c), - local upLetter(c) = if cp(c) >= 97 && cp(c) < 123 then - std.char(cp(c) - 32) - else c, - result:: std.join("", std.map(upLetter, std.stringChars(x))), - }.result, - // Convert non-boolean types like string,number to a boolean. // This is primarily intended for dealing with parameters that should be booleans. toBool:: function(x) { @@ -32,7 +22,7 @@ if std.type(x) == "boolean" then x else if std.type(x) == "string" then - $.upper(x) == "TRUE" + std.asciiUpper(x) == "TRUE" else if std.type(x) == "number" then x != 0 else diff --git a/kubeflow/weaveflux/util.libsonnet b/kubeflow/weaveflux/util.libsonnet index c3b07c3aa04..c523be33ae3 100644 --- a/kubeflow/weaveflux/util.libsonnet +++ b/kubeflow/weaveflux/util.libsonnet @@ -1,15 +1,5 @@ // Some useful routines. { - // TODO(https://github.com/kubeflow/kubeflow/issues/1826): Replace with std.asciiUpper once supported by required version of jsonnet - // Convert a string to upper case. - upper:: function(x) { - local cp(c) = std.codepoint(c), - local upLetter(c) = if cp(c) >= 97 && cp(c) < 123 then - std.char(cp(c) - 32) - else c, - result:: std.join("", std.map(upLetter, std.stringChars(x))), - }.result, - // Convert non-boolean types like string,number to a boolean. // This is primarily intended for dealing with parameters that should be booleans. toBool:: function(x) { @@ -17,7 +7,7 @@ if std.type(x) == "boolean" then x else if std.type(x) == "string" then - $.upper(x) == "TRUE" + std.asciiUpper(x) == "TRUE" else if std.type(x) == "number" then x != 0 else diff --git a/testing/workflows/components/workflows.libsonnet b/testing/workflows/components/workflows.libsonnet index 54b02287db3..bd82dcd97da 100644 --- a/testing/workflows/components/workflows.libsonnet +++ b/testing/workflows/components/workflows.libsonnet @@ -23,7 +23,7 @@ if std.type(x) == "boolean" then x else if std.type(x) == "string" then - $.upper(x) == "TRUE" + std.asciiUpper(x) == "TRUE" else if std.type(x) == "number" then x != 0 else