Fix python imports and replace const char array with constexpr

This commit is contained in:
Kostas Kyrimis 2022-11-28 17:13:58 +02:00
parent 8fd7327fbd
commit 50df0d4d53
4 changed files with 12 additions and 8 deletions

View File

@ -99,7 +99,7 @@ jobs:
echo ${file} echo ${file}
if [[ ${file} == *.py ]]; then if [[ ${file} == *.py ]]; then
python3 -m black --check --diff ${file} python3 -m black --check --diff ${file}
python3 -m isort --check-only --diff ${file} python3 -m isort --check-only --profile "black" --diff ${file}
fi fi
done done

View File

@ -14,6 +14,7 @@ repos:
hooks: hooks:
- id: isort - id: isort
name: isort (python) name: isort (python)
args: ["--profile", "black"]
- repo: https://github.com/pre-commit/mirrors-clang-format - repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0 rev: v13.0.0
hooks: hooks:

View File

@ -56,10 +56,10 @@ template <typename TypedValueT, typename FunctionContextT, typename Tag, typenam
std::function<TypedValueT(const TypedValueT *arguments, int64_t num_arguments, const FunctionContextT &context)> std::function<TypedValueT(const TypedValueT *arguments, int64_t num_arguments, const FunctionContextT &context)>
NameToFunction(const std::string &function_name); NameToFunction(const std::string &function_name);
inline const char kStartsWith[] = "STARTSWITH"; inline constexpr char kStartsWith[] = "STARTSWITH";
inline const char kEndsWith[] = "ENDSWITH"; inline constexpr char kEndsWith[] = "ENDSWITH";
inline const char kContains[] = "CONTAINS"; inline constexpr char kContains[] = "CONTAINS";
inline const char kId[] = "ID"; inline constexpr char kId[] = "ID";
} // namespace memgraph::functions } // namespace memgraph::functions

View File

@ -10,13 +10,16 @@
# licenses/APL.txt. # licenses/APL.txt.
import sys import sys
import time
import typing
import mgclient import mgclient
import pytest import pytest
from common import * from common import (
connection,
execute_and_fetch_all,
has_n_result_row,
wait_for_shard_manager_to_initialize,
)
def test_awesome_memgraph_functions(connection): def test_awesome_memgraph_functions(connection):