Skip to content

Commit 926dd95

Browse files
aheevadsharma
authored andcommitted
purge ku
1 parent a9108e4 commit 926dd95

File tree

11 files changed

+34
-34
lines changed

11 files changed

+34
-34
lines changed

src_cpp/include/py_object_container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class PythonObjectContainer {
2222
}
2323

2424
const py::object& getLastAddedObject() {
25-
KU_ASSERT(!pyObjects.empty());
25+
LBUG_ASSERT(!pyObjects.empty());
2626
return pyObjects.back();
2727
}
2828

src_cpp/numpy/numpy_scan.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ void ScanNumpyColumn(py::array& npArray, uint64_t offset, ValueVector* outputVec
2222
template<class T>
2323
void scanNumpyMasked(PandasColumnBindData* bindData, uint64_t count, uint64_t offset,
2424
ValueVector* outputVector) {
25-
KU_ASSERT(bindData->pandasCol->getBackEnd() == PandasColumnBackend::NUMPY);
25+
LBUG_ASSERT(bindData->pandasCol->getBackEnd() == PandasColumnBackend::NUMPY);
2626
auto& npColumn = reinterpret_cast<PandasNumpyColumn&>(*bindData->pandasCol);
2727
ScanNumpyColumn<T>(npColumn.array, offset, outputVector, count);
2828
if (bindData->mask != nullptr) {
29-
KU_UNREACHABLE;
29+
LBUG_UNREACHABLE;
3030
}
3131
}
3232

@@ -52,7 +52,7 @@ static void appendPythonUnicode(T* codepoints, uint64_t codepointLength,
5252
uint64_t utf8StrLen = 0;
5353
for (auto i = 0u; i < codepointLength; i++) {
5454
auto len = utf8proc::Utf8Proc::codepointLength(int(codepoints[i]));
55-
KU_ASSERT(len >= 1);
55+
LBUG_ASSERT(len >= 1);
5656
utf8StrLen += len;
5757
}
5858
auto& strToAppend = StringVector::reserveString(vectorToAppend, pos, utf8StrLen);
@@ -63,17 +63,17 @@ static void appendPythonUnicode(T* codepoints, uint64_t codepointLength,
6363
auto dataToWrite = (char*)strToAppend.getData();
6464
for (auto i = 0u; i < codepointLength; i++) {
6565
utf8proc::Utf8Proc::codepointToUtf8(int(codepoints[i]), codePointLen, dataToWrite);
66-
KU_ASSERT(codePointLen >= 1);
66+
LBUG_ASSERT(codePointLen >= 1);
6767
dataToWrite += codePointLen;
6868
}
69-
if (!ku_string_t::isShortString(utf8StrLen)) {
70-
memcpy(strToAppend.prefix, strToAppend.getData(), ku_string_t::PREFIX_LENGTH);
69+
if (!string_t::isShortString(utf8StrLen)) {
70+
memcpy(strToAppend.prefix, strToAppend.getData(), string_t::PREFIX_LENGTH);
7171
}
7272
}
7373

7474
void NumpyScan::scan(PandasColumnBindData* bindData, uint64_t count, uint64_t offset,
7575
common::ValueVector* outputVector) {
76-
KU_ASSERT(bindData->pandasCol->getBackEnd() == PandasColumnBackend::NUMPY);
76+
LBUG_ASSERT(bindData->pandasCol->getBackEnd() == PandasColumnBackend::NUMPY);
7777
auto& npCol = reinterpret_cast<PandasNumpyColumn&>(*bindData->pandasCol);
7878
auto& array = npCol.array;
7979

@@ -151,7 +151,7 @@ void NumpyScan::scan(PandasColumnBindData* bindData, uint64_t count, uint64_t of
151151
scanObjectColumn(sourceData, count, offset, outputVector);
152152
return;
153153
}
154-
auto dstData = reinterpret_cast<ku_string_t*>(outputVector->getData());
154+
auto dstData = reinterpret_cast<string_t*>(outputVector->getData());
155155
py::gil_scoped_acquire gil;
156156
for (auto i = 0u; i < count; i++) {
157157
auto pos = i + offset;
@@ -176,12 +176,12 @@ void NumpyScan::scan(PandasColumnBindData* bindData, uint64_t count, uint64_t of
176176
}
177177
outputVector->setNull(i, false /* isNull */);
178178
if (PyStrUtil::isPyUnicodeCompatibleAscii(strHandle)) {
179-
dstData[i] = ku_string_t{PyStrUtil::getUnicodeStrData(strHandle),
179+
dstData[i] = string_t{PyStrUtil::getUnicodeStrData(strHandle),
180180
PyStrUtil::getUnicodeStrLen(strHandle)};
181181
} else {
182182
auto unicodeObj = reinterpret_cast<PyCompactUnicodeObject*>(val);
183183
if (unicodeObj->utf8) {
184-
dstData[i] = ku_string_t(reinterpret_cast<const char*>(unicodeObj->utf8),
184+
dstData[i] = string_t(reinterpret_cast<const char*>(unicodeObj->utf8),
185185
unicodeObj->utf8_length);
186186
} else if (PyStrUtil::isPyUnicodeCompact(unicodeObj) &&
187187
!PyStrUtil::isPyUnicodeASCII(unicodeObj)) {
@@ -200,7 +200,7 @@ void NumpyScan::scan(PandasColumnBindData* bindData, uint64_t count, uint64_t of
200200
PyStrUtil::getUnicodeStrLen(strHandle), outputVector, i);
201201
break;
202202
default:
203-
KU_UNREACHABLE;
203+
LBUG_UNREACHABLE;
204204
}
205205
} else {
206206
// LCOV_EXCL_START
@@ -212,7 +212,7 @@ void NumpyScan::scan(PandasColumnBindData* bindData, uint64_t count, uint64_t of
212212
break;
213213
}
214214
default:
215-
KU_UNREACHABLE;
215+
LBUG_UNREACHABLE;
216216
}
217217
}
218218

src_cpp/numpy/numpy_type.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static NumpyNullableType convertNumpyTypeInternal(const std::string& colTypeStr)
8383
if (colTypeStr == "object" || colTypeStr == "string") {
8484
return NumpyNullableType::OBJECT;
8585
}
86-
KU_UNREACHABLE;
86+
LBUG_UNREACHABLE;
8787
}
8888

8989
NumpyType NumpyTypeUtils::convertNumpyType(const py::handle& colType) {
@@ -142,7 +142,7 @@ LogicalType NumpyTypeUtils::numpyToLogicalType(const NumpyType& col_type) {
142142
case NumpyNullableType::OBJECT:
143143
return LogicalType(LogicalTypeID::STRING);
144144
default:
145-
KU_UNREACHABLE;
145+
LBUG_UNREACHABLE;
146146
}
147147
}
148148

src_cpp/pandas/pandas_analyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ common::LogicalType PandasAnalyzer::getItemType(py::object ele, bool& canConvert
177177
return dictToStruct(dict, canConvert);
178178
}
179179
default:
180-
KU_UNREACHABLE;
180+
LBUG_UNREACHABLE;
181181
}
182182
}
183183

src_cpp/pandas/pandas_bind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct PandasDataFrameBind {
2626
getter = df.attr("__getitem__");
2727
}
2828
PandasBindColumn operator[](uint64_t index) const {
29-
KU_ASSERT(index < names.size());
29+
LBUG_ASSERT(index < names.size());
3030
auto column = py::reinterpret_borrow<py::object>(getter(names[index]));
3131
auto type = types[index];
3232
auto name = names[index];

src_cpp/pandas/pandas_scan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ std::unique_ptr<TableFuncBindData> bindFunc(ClientContext* /*context*/,
2828
std::vector<LogicalType> returnTypes;
2929
std::vector<std::string> names;
3030
if (py::isinstance<py::dict>(df)) {
31-
KU_UNREACHABLE;
31+
LBUG_UNREACHABLE;
3232
} else {
3333
Pandas::bind(df, columnBindData, returnTypes, names);
3434
}
@@ -39,7 +39,7 @@ std::unique_ptr<TableFuncBindData> bindFunc(ClientContext* /*context*/,
3939
auto scanConfig = PyScanConfig{
4040
input->extraInput->constPtrCast<ExtraScanTableFuncBindInput>()->fileScanInfo.options,
4141
numRows};
42-
KU_ASSERT(numRows >= scanConfig.skipNum);
42+
LBUG_ASSERT(numRows >= scanConfig.skipNum);
4343
return std::make_unique<PandasScanFunctionData>(std::move(returnColumns), df,
4444
std::min(numRows - scanConfig.skipNum, scanConfig.limitNum), std::move(columnBindData),
4545
scanConfig);
@@ -68,7 +68,7 @@ void pandasBackendScanSwitch(PandasColumnBindData* bindData, uint64_t count, uin
6868
NumpyScan::scan(bindData, count, offset, outputVector);
6969
} break;
7070
default:
71-
KU_UNREACHABLE;
71+
LBUG_UNREACHABLE;
7272
}
7373
}
7474

src_cpp/py_connection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void PyConnection::getAllEdgesForTorchGeometric(py::array_t<int64_t>& npArray,
229229
if (!result->isSuccess()) {
230230
throw std::runtime_error(result->getErrorMessage());
231231
}
232-
KU_ASSERT(result->getType() == QueryResultType::FTABLE);
232+
LBUG_ASSERT(result->getType() == QueryResultType::FTABLE);
233233
auto& table = result->constCast<MaterializedQueryResult>().getFactorizedTable();
234234
auto tableSchema = table.getTableSchema();
235235
if (tableSchema->getColumn(0)->isFlat() && !tableSchema->getColumn(1)->isFlat()) {
@@ -641,7 +641,7 @@ Value PyConnection::transformPythonValueAs(const py::handle& val, const LogicalT
641641
case LogicalTypeID::UUID: {
642642
auto strVal = py::str(val).cast<std::string>();
643643
auto uuidVal = UUID::fromString(strVal);
644-
ku_uuid_t uuidToAppend{uuidVal};
644+
uuid uuidToAppend{uuidVal};
645645
return Value{uuidToAppend};
646646
}
647647
case LogicalTypeID::LIST: {
@@ -687,7 +687,7 @@ Value PyConnection::transformPythonValueAs(const py::handle& val, const LogicalT
687687
}
688688
// LCOV_EXCL_START
689689
default:
690-
KU_UNREACHABLE;
690+
LBUG_UNREACHABLE;
691691
// LCOV_EXCL_STOP
692692
}
693693
}

src_cpp/py_conversion.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static std::vector<std::string> transformStructKeys(py::handle keys, idx_t size)
8181

8282
void transformDictionaryToStruct(common::ValueVector* outputVector, uint64_t pos,
8383
const PyDictionary& dict) {
84-
KU_ASSERT(outputVector->dataType.getLogicalTypeID() == LogicalTypeID::STRUCT);
84+
LBUG_ASSERT(outputVector->dataType.getLogicalTypeID() == LogicalTypeID::STRUCT);
8585
auto structKeys = transformStructKeys(dict.keys, dict.len);
8686
if (StructType::getNumFields(outputVector->dataType) != dict.len) {
8787
throw common::ConversionException(
@@ -104,7 +104,7 @@ void transformDictionaryToStruct(common::ValueVector* outputVector, uint64_t pos
104104

105105
void transformDictionaryToMap(common::ValueVector* outputVector, uint64_t pos,
106106
const PyDictionary& dict) {
107-
KU_ASSERT(outputVector->dataType.getLogicalTypeID() == LogicalTypeID::MAP);
107+
LBUG_ASSERT(outputVector->dataType.getLogicalTypeID() == LogicalTypeID::MAP);
108108
auto keys = dict.values.attr("__getitem__")(0);
109109
auto values = dict.values.attr("__getitem__")(1);
110110

@@ -114,7 +114,7 @@ void transformDictionaryToMap(common::ValueVector* outputVector, uint64_t pos,
114114
}
115115

116116
auto numKeys = py::len(keys);
117-
KU_ASSERT(numKeys == py::len(values));
117+
LBUG_ASSERT(numKeys == py::len(values));
118118
auto listEntry = ListVector::addList(outputVector, numKeys);
119119
outputVector->setValue(pos, listEntry);
120120
auto structVector = ListVector::getDataVector(outputVector);
@@ -203,11 +203,11 @@ void transformPythonValue(common::ValueVector* outputVector, uint64_t pos, py::h
203203
transformDictionaryToMap(outputVector, pos, dict);
204204
} break;
205205
default:
206-
KU_UNREACHABLE;
206+
LBUG_UNREACHABLE;
207207
}
208208
} break;
209209
default:
210-
KU_UNREACHABLE;
210+
LBUG_UNREACHABLE;
211211
}
212212
}
213213

src_cpp/py_query_result_converter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void NPArrayWrapper::appendElement(Value* value) {
103103
((py::dict*)dataBuffer)[numElements] = PyQueryResult::convertValueToPyObject(*value);
104104
} break;
105105
default: {
106-
KU_UNREACHABLE;
106+
LBUG_UNREACHABLE;
107107
}
108108
}
109109
}
@@ -182,7 +182,7 @@ py::dtype NPArrayWrapper::convertToArrayType(const LogicalType& type) {
182182
dtype = "object";
183183
} break;
184184
default: {
185-
KU_UNREACHABLE;
185+
LBUG_UNREACHABLE;
186186
}
187187
}
188188
return py::dtype(dtype);

src_cpp/pyarrow/pyarrow_scan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static bool moduleIsLoaded() {
2727

2828
static std::unique_ptr<TableFuncBindData> bindFunc(ClientContext*,
2929
const TableFuncBindInput* input) {
30-
auto scanInput = ku_dynamic_cast<ExtraScanTableFuncBindInput*>(input->extraInput.get());
30+
auto scanInput = dynamic_cast_checked<ExtraScanTableFuncBindInput*>(input->extraInput.get());
3131
// TODO: This binding step could use some drastic improvements.
3232
// Particularly when scanning from pandas or polars.
3333
// Possibly look into using the pycapsule interface.
@@ -43,7 +43,7 @@ static std::unique_ptr<TableFuncBindData> bindFunc(ClientContext*,
4343
std::vector<LogicalType> returnTypes;
4444
std::vector<std::string> names;
4545
if (py::isinstance<py::dict>(table)) {
46-
KU_UNREACHABLE;
46+
LBUG_UNREACHABLE;
4747
}
4848
auto numRows = py::len(table);
4949
auto schema = Pyarrow::bind(table, returnTypes, names);
@@ -112,7 +112,7 @@ static offset_t tableFunc(const TableFuncInput& input, TableFuncOutput& output)
112112
}
113113

114114
static double progressFunc(TableFuncSharedState* sharedState) {
115-
PyArrowTableScanSharedState* state = ku_dynamic_cast<PyArrowTableScanSharedState*>(sharedState);
115+
PyArrowTableScanSharedState* state = dynamic_cast_checked<PyArrowTableScanSharedState*>(sharedState);
116116
if (state->chunks.size() == 0) {
117117
return 0.0;
118118
}

0 commit comments

Comments
 (0)