这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
CIBW_BUILD: "cp3{7,8,9}-*"
CIBW_SKIP: "cp3{5,6}-macosx* pp* *-musllinux_*"

CIBW_BEFORE_BUILD_MACOS: brew install coreutils protobuf zstd zlib libmagic llvm@9 pcre2 antlr4-cpp-runtime googletest gflags yaml-cpp celero wget boost && bash ./scripts/macos/install_aws-sdk-cpp.sh
CIBW_BEFORE_BUILD_MACOS: bash ./scripts/macos/brew_dependencies.sh && bash ./scripts/macos/install_aws-sdk-cpp.sh
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"

# set this environment variable to include the Lambda zip from the previous build step
Expand Down
13 changes: 13 additions & 0 deletions scripts/macos/brew_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# This script installs all required dependencies via brew
# for instructions on how to install brew, visit https://brew.sh/

brew install coreutils protobuf zstd zlib libmagic llvm@9 pcre2 gflags yaml-cpp celero wget boost googletest

# latest antlr4-cpp-runtime 4.10 and googletest have a conflict
# in addition to 4.10 requiring C++20 to compile.
# Therefore, install old 4.9.3 Antlr4 version
# i.e., it used to be brew install antlr4-cpp-runtime, now use the following:
brew tap-new tuplex/brew
brew extract --version='4.9.3' antlr4-cpp-runtime tuplex/brew
brew install antlr4-cpp-runtime@4.9.3
8 changes: 7 additions & 1 deletion tuplex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ option(USE_LD_GOLD "Use GNU gold linker" ON)

# set default MacOS target, if not set.
# cf. https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
# use high sierra target per default
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
endif()
Expand Down Expand Up @@ -133,6 +133,12 @@ enable_testing()
# detect MacOS Version because at least 10.13 is required when building with AWS SDK
if(APPLE)
execute_process(COMMAND bash -c "sw_vers | grep -Eo '([0-9]{1,}\.)+[0-9]{1,}' | head -1" OUTPUT_VARIABLE MACOSX_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)

if(NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
# use high sierra target per default
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
endif()

message(STATUS "Detected macOS ${MACOSX_VERSION_STRING} host platform, building for deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}. To use a different deployment target either set CMAKE_OSX_DEPLOYMENT_TARGET or the environment variable MACOSX_DEPLOYMENT_TARGET to the desired version.")
endif()

Expand Down
1 change: 0 additions & 1 deletion tuplex/cmake/FindANTLR4Runtime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# find include (is e.g. in /usr/local/include/antlr4-runtime/antlr4-runtime.h
find_path(ANTLR4Runtime_INCLUDE_DIR NAMES "antlr4-runtime.h" PATH_SUFFIXES "antlr4-runtime")


# find lib
find_library(ANTLR4Runtime_LIB antlr4-runtime)

Expand Down
1 change: 0 additions & 1 deletion tuplex/codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ endif()
# BOOST libs
include_directories(${Boost_INCLUDE_DIR})


# ANTLR4 Runtime (installed e.g. via brew install antlr4-cpp-runtime)
find_package(ANTLR4Runtime REQUIRED)

Expand Down
4 changes: 3 additions & 1 deletion tuplex/codegen/src/SymbolTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,9 @@ namespace tuplex {
if(jt != scope->symbols.end()) {
auto symbol = jt->second;
python::Type matchType = python::Type::UNKNOWN;
if(symbol->findFunctionTypeBasedOnParameterType(parameterType, matchType))

// symbol may be nullptr, this indicates e.g. an attribute.
if(symbol && symbol->findFunctionTypeBasedOnParameterType(parameterType, matchType))
return matchType;
}
}
Expand Down
27 changes: 27 additions & 0 deletions tuplex/test/core/SymbolsTest.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//--------------------------------------------------------------------------------------------------------------------//
// //
// Tuplex: Blazing Fast Python Data Science //
// //
// //
// (c) 2017 - 2021, Tuplex team //
// Created by Leonhard Spiegelberg first on 4/22/2022 //
// License: Apache 2.0 //
//--------------------------------------------------------------------------------------------------------------------//

#include "gtest/gtest.h"
#include <Context.h>
#include "../../utils/include/Utils.h"
#include "TestUtils.h"

class SymbolProcessTest : public PyTest {};

TEST_F(SymbolProcessTest, MissingSymbol) {
// make sure code doesn't crash when symbols are missing
using namespace tuplex;
using namespace std;
// c.csv(...).mapColumn('title', lambda x: split(x)[0]) --> split is a non-defined symbol!
auto path = "../resources/zillow_data.csv";
Context c(microTestOptions());

auto v = c.csv(path).mapColumn("title", UDF("lambda x: split(x)[0]")).collectAsVector();
}