Skip to content

Commit

Permalink
Merge branch 'main' into csv-utility
Browse files Browse the repository at this point in the history
  • Loading branch information
mpintaric55334 authored Oct 26, 2023
2 parents 6526308 + 27c6a76 commit 08e0b03
Show file tree
Hide file tree
Showing 115 changed files with 1,294 additions and 928 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
MEMGRAPH_PORT: 7687
NEO4J_PORT: 7688
NEO4J_CONTAINER: "neo4j_test"
OFFICIAL: "true"
OFFICIAL: "false"

on: [pull_request, workflow_dispatch]

Expand All @@ -16,10 +16,11 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: True
env:
MEMGRAPH_VERSION: 2.11.0
MEMGRAPH_VERSION: 2.12.0
strategy:
matrix:
architecture: ["amd64", "arm64"]
#architecture: ["amd64", "arm64"]
architecture: ["amd64"]
target: ["prod", "dev"]
steps:
- name: Checkout repository and submodules
Expand All @@ -44,7 +45,7 @@ jobs:
else
sudo apt update && sudo apt install -y ca-certificates wget git
wget -q https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/memgraph-unofficial/memgraph_${MEMGRAPH_VERSION}-1_amd64.deb -O memgraph-amd64.deb
wget -q https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/memgraph-unofficial/memgraph_${MEMGRAPH_VERSION}-1_arm64.deb -O memgraph-arm64.deb
# wget -q https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/memgraph-unofficial/memgraph_${MEMGRAPH_VERSION}-1_arm64.deb -O memgraph-arm64.deb
fi
- name: Disk status before cleaning
Expand All @@ -63,7 +64,7 @@ jobs:
run: |
df -h
docker buildx du
- name: Rust library tests
if: matrix.target == 'dev'
run: |
Expand All @@ -73,7 +74,7 @@ jobs:
- name: Build and run Memgraph MAGE:${{ matrix.target }}
run: |
DOCKER_BUILDKIT=1 docker buildx build \
--tag memgraph-mage:${{ matrix.target }} \
--target ${{ matrix.target }} \
Expand Down Expand Up @@ -127,18 +128,18 @@ jobs:
run: |
docker exec -i -u root ${{ env.MAGE_CONTAINER }} bash -c "cd /mage/python/ && python3 -m pytest ."
- name: Run End-to-end tests
if: matrix.architecture != 'arm64'
#if: matrix.architecture != 'arm64'
env:
PYTHONPATH: "$PWD/e2e"
run: |
cd e2e
docker exec -i -u root ${{ env.MAGE_CONTAINER }} bash -c "cd /mage/e2e/ && python3 -m pytest . -k 'not cugraph'"
- name: Run End-to-end correctness tests
if: matrix.architecture != 'arm64'
#if: matrix.architecture != 'arm64'
env:
PYTHONPATH: "$PWD/e2e"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "cpp/memgraph"]
path = cpp/memgraph
url = https://github.com/memgraph/memgraph.git
branch = release/2.11
branch = T675-MAGE-temp-build
1 change: 0 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ add_subdirectory(path_module)
add_subdirectory(node_module)
add_subdirectory(neighbors_module)
add_subdirectory(refactor_module)
add_subdirectory(schema_module)
add_subdirectory(csv_utils_module)

add_cugraph_subdirectory(cugraph_module)
34 changes: 17 additions & 17 deletions cpp/collections_module/algorithm/collections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void Collections::SetResult(mgp::Result &result, const mgp::Value &value) {
}

void Collections::SumLongs(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);

Expand All @@ -67,7 +67,7 @@ void Collections::SumLongs(mgp_list *args, mgp_func_context *ctx, mgp_func_resul
}

void Collections::Avg(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);

Expand All @@ -94,7 +94,7 @@ void Collections::Avg(mgp_list *args, mgp_func_context *ctx, mgp_func_result *re
}

void Collections::ContainsAll(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);

Expand All @@ -115,7 +115,7 @@ void Collections::ContainsAll(mgp_list *args, mgp_func_context *ctx, mgp_func_re
}

void Collections::Intersection(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);

Expand Down Expand Up @@ -147,7 +147,7 @@ void Collections::Intersection(mgp_list *args, mgp_func_context *ctx, mgp_func_r
}

void Collections::RemoveAll(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);

Expand Down Expand Up @@ -181,7 +181,7 @@ void Collections::RemoveAll(mgp_list *args, mgp_func_context *ctx, mgp_func_resu
}

void Collections::Sum(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand All @@ -204,7 +204,7 @@ void Collections::Sum(mgp_list *args, mgp_func_context *ctx, mgp_func_result *re
}

void Collections::Union(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand Down Expand Up @@ -249,7 +249,7 @@ void Collections::Union(mgp_list *args, mgp_func_context *ctx, mgp_func_result *
}

void Collections::Sort(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand All @@ -271,7 +271,7 @@ void Collections::Sort(mgp_list *args, mgp_func_context *ctx, mgp_func_result *r
}

void Collections::ContainsSorted(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand Down Expand Up @@ -304,7 +304,7 @@ void Collections::ContainsSorted(mgp_list *args, mgp_func_context *ctx, mgp_func
}

void Collections::Max(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand All @@ -331,7 +331,7 @@ void Collections::Max(mgp_list *args, mgp_func_context *ctx, mgp_func_result *re
}

void Collections::Split(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);
Expand Down Expand Up @@ -370,7 +370,7 @@ void Collections::Split(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *r
}

void Collections::Pairs(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand Down Expand Up @@ -401,7 +401,7 @@ void Collections::Pairs(mgp_list *args, mgp_func_context *ctx, mgp_func_result *
}

void Collections::Contains(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand Down Expand Up @@ -429,7 +429,7 @@ void Collections::Contains(mgp_list *args, mgp_func_context *ctx, mgp_func_resul
}

void Collections::UnionAll(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand All @@ -448,7 +448,7 @@ void Collections::UnionAll(mgp_list *args, mgp_func_context *ctx, mgp_func_resul
}

void Collections::Min(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand Down Expand Up @@ -486,7 +486,7 @@ void Collections::Min(mgp_list *args, mgp_func_context *ctx, mgp_func_result *re
}

void Collections::ToSet(mgp_list *args, mgp_func_context *ctx, mgp_func_result *res, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
auto arguments = mgp::List(args);
auto result = mgp::Result(res);
try {
Expand All @@ -506,7 +506,7 @@ void Collections::ToSet(mgp_list *args, mgp_func_context *ctx, mgp_func_result *
}

void Collections::Partition(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);
try {
Expand Down
2 changes: 1 addition & 1 deletion cpp/collections_module/collections_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

extern "C" int mgp_init_module(struct mgp_module *module, struct mgp_memory *memory) {
try {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

mgp::AddFunction(Collections::SumLongs, Collections::kProcedureSumLongs,
{mgp::Parameter(Collections::kSumLongsArg1, {mgp::Type::List, mgp::Type::Any})}, module, memory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::string saved_weight_property = kDefaultWeightProperty.data();

void Set(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
try {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto graph = mgp::Graph(memgraph_graph);
const auto arguments = mgp::List(args);
Expand Down Expand Up @@ -90,7 +90,7 @@ void Set(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memo

void Get(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
try {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto graph = mgp::Graph(memgraph_graph);
const auto record_factory = mgp::RecordFactory(result);
Expand Down Expand Up @@ -119,7 +119,7 @@ void Get(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memo

void Update(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
try {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto graph = mgp::Graph(memgraph_graph);
const auto arguments = mgp::List(args);
Expand Down Expand Up @@ -189,7 +189,7 @@ void Update(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_m

void Reset(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
try {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto record_factory = mgp::RecordFactory(result);

Expand All @@ -203,7 +203,7 @@ void Reset(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_me
auto record = record_factory.NewRecord();
record.Insert(kFieldMessage.data(), "The algorithm has been successfully reset!");
} catch (const std::exception &e) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto record_factory = mgp::RecordFactory(result);
auto record = record_factory.NewRecord();
Expand All @@ -216,7 +216,7 @@ void Reset(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_me

extern "C" int mgp_init_module(struct mgp_module *module, struct mgp_memory *memory) {
try {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;

const auto node_list = std::make_pair(mgp::Type::List, mgp::Type::Node);
const auto relationship_list = std::make_pair(mgp::Type::List, mgp::Type::Relationship);
Expand Down
20 changes: 10 additions & 10 deletions cpp/create_module/algorithm/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void ModifyAndOutput(mgp::Relationship &relationship, const mgp::List &keys, con
} // namespace

void Create::RemoveRelProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);

Expand Down Expand Up @@ -80,7 +80,7 @@ void Create::RemoveRelProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_
}

void Create::SetRelProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);

Expand Down Expand Up @@ -131,7 +131,7 @@ void Create::SetRelProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_res
}

void Create::Relationship(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);

Expand Down Expand Up @@ -181,7 +181,7 @@ void Create::ProcessElement(const mgp::Value &element, const mgp::Graph graph, c
}

void Create::SetRelProperty(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto graph = mgp::Graph(memgraph_graph);
const auto record_factory = mgp::RecordFactory(result);
Expand Down Expand Up @@ -256,7 +256,7 @@ void Create::ProcessElement(const mgp::Value &element, const mgp::Graph graph, c
}

void Create::RemoveLabels(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto graph = mgp::Graph(memgraph_graph);
const auto record_factory = mgp::RecordFactory(result);
Expand All @@ -278,7 +278,7 @@ void Create::RemoveLabels(mgp_list *args, mgp_graph *memgraph_graph, mgp_result
}

void Create::RemoveProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);
try {
Expand Down Expand Up @@ -324,7 +324,7 @@ void Create::ProcessElement(const mgp::Value &element, const mgp::Graph graph, c
}

void Create::SetProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto graph = mgp::Graph(memgraph_graph);
const auto record_factory = mgp::RecordFactory(result);
Expand All @@ -351,7 +351,7 @@ void Create::SetProperties(mgp_list *args, mgp_graph *memgraph_graph, mgp_result
}

void Create::Node(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
auto graph = mgp::Graph(memgraph_graph);
const auto record_factory = mgp::RecordFactory(result);
Expand Down Expand Up @@ -379,7 +379,7 @@ void Create::Node(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result,
}

void Create::Nodes(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);
try {
Expand Down Expand Up @@ -407,7 +407,7 @@ void Create::Nodes(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result
}

void Create::SetProperty(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_memory *memory) {
mgp::memory = memory;
mgp::MemoryDispatcherGuard guard{memory};;
const auto arguments = mgp::List(args);
const auto record_factory = mgp::RecordFactory(result);
try {
Expand Down
Loading

0 comments on commit 08e0b03

Please sign in to comment.