From f6fa587bdd581c0e05297e871df5e916f778b773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ko=C5=82akowski?= Date: Sun, 23 Feb 2025 20:54:18 +0100 Subject: [PATCH] Fix prettier issues --- .../js/sql/reference/flink/udfReference.ts | 52 +++++++------------ .../src/notebook/connectors/flink_sql.py | 6 +-- 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/desktop/core/src/desktop/js/sql/reference/flink/udfReference.ts b/desktop/core/src/desktop/js/sql/reference/flink/udfReference.ts index b9f29a5be61..5f1fb11415d 100644 --- a/desktop/core/src/desktop/js/sql/reference/flink/udfReference.ts +++ b/desktop/core/src/desktop/js/sql/reference/flink/udfReference.ts @@ -112,8 +112,7 @@ const STRING_FUNCTIONS: UdfCategoryFunctions = { arguments: [[{ type: 'STRING' }]], signature: 'char_length(STRING value)', draggable: 'char_length()', - description: - "Returns the number of characters in STRING." + description: 'Returns the number of characters in STRING.' }, character_length: { name: 'character_length', @@ -121,8 +120,7 @@ const STRING_FUNCTIONS: UdfCategoryFunctions = { arguments: [[{ type: 'STRING' }]], signature: 'character_length(STRING value)', draggable: 'character_length()', - description: - "Returns the number of characters in STRING." + description: 'Returns the number of characters in STRING.' }, lower: { name: 'lower', @@ -130,8 +128,7 @@ const STRING_FUNCTIONS: UdfCategoryFunctions = { arguments: [[{ type: 'STRING' }]], signature: 'lower(STRING value)', draggable: 'lower()', - description: - "Returns string in lowercase." + description: 'Returns string in lowercase.' }, regexp_extract: { name: 'regexp_extract', @@ -148,8 +145,7 @@ const STRING_FUNCTIONS: UdfCategoryFunctions = { arguments: [[{ type: 'STRING' }]], signature: 'upper(STRING value)', draggable: 'upper()', - description: - "Returns string in uppercase." + description: 'Returns string in uppercase.' } }; @@ -517,28 +513,23 @@ const ARITHMETIC_FUNCTIONS: UdfCategoryFunctions = { abs: { name: 'abs', returnTypes: ['NUMERIC'], - arguments: [[{ type: 'numeric'}]], + arguments: [[{ type: 'numeric' }]], signature: 'abs(numeric)', draggable: 'abs(numeric)', - description: - 'Returns the absolute value of numeric.' + description: 'Returns the absolute value of numeric.' }, ln: { name: 'ln', returnTypes: ['NUMERIC'], - arguments: [[{ type: 'numeric'}]], + arguments: [[{ type: 'numeric' }]], signature: 'ln(numeric)', draggable: 'ln(numeric)', - description: - 'Returns the natural logarithm (base e) of numeric.' + description: 'Returns the natural logarithm (base e) of numeric.' }, log: { name: 'log', returnTypes: ['NUMERIC'], - arguments: [ - [{ type: 'numeric'}], - [{ type: 'numeric', optional: true }], - ], + arguments: [[{ type: 'numeric' }], [{ type: 'numeric', optional: true }]], signature: 'log(NUMERIC numeric1[, NUMERIC numeric2])', draggable: 'log()', description: @@ -547,42 +538,35 @@ const ARITHMETIC_FUNCTIONS: UdfCategoryFunctions = { log10: { name: 'log10', returnTypes: ['NUMERIC'], - arguments: [[{ type: 'numeric'}]], + arguments: [[{ type: 'numeric' }]], signature: 'log10(NUMERIC numeric)', draggable: 'log10()', - description: - 'Returns the base 10 logarithm of numeric.' + description: 'Returns the base 10 logarithm of numeric.' }, log2: { name: 'log2', returnTypes: ['NUMERIC'], - arguments: [[{ type: 'numeric'}]], + arguments: [[{ type: 'numeric' }]], signature: 'log2(NUMERIC numeric)', draggable: 'log2()', - description: - 'Returns the base 2 logarithm of numeric.' + description: 'Returns the base 2 logarithm of numeric.' }, power: { name: 'power', returnTypes: ['NUMERIC'], - arguments: [ - [{ type: 'NUMERIC' }], - [{ type: 'NUMERIC' }], - ], + arguments: [[{ type: 'NUMERIC' }], [{ type: 'NUMERIC' }]], signature: 'power(NUMERIC numeric1, NUMERIC numeric2)', draggable: 'power()', - description: - 'Returns numeric1 raised to the power of numeric2 (numeric1^numeric2).' + description: 'Returns numeric1 raised to the power of numeric2 (numeric1^numeric2).' }, sqrt: { name: 'sqrt', returnTypes: ['NUMERIC'], - arguments: [[{ type: 'numeric'}]], + arguments: [[{ type: 'numeric' }]], signature: 'sqrt(NUMERIC numeric)', draggable: 'sqrt()', - description: - 'Returns the square root of numeric.' - }, + description: 'Returns the square root of numeric.' + } }; export const UDF_CATEGORIES: UdfCategory[] = [ diff --git a/desktop/libs/notebook/src/notebook/connectors/flink_sql.py b/desktop/libs/notebook/src/notebook/connectors/flink_sql.py index a37eb19a9c3..f0111772b63 100644 --- a/desktop/libs/notebook/src/notebook/connectors/flink_sql.py +++ b/desktop/libs/notebook/src/notebook/connectors/flink_sql.py @@ -15,13 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import - +import re import json +import time import logging import posixpath -import re -import time from desktop.auth.backend import rewrite_user from desktop.lib.i18n import force_unicode