Skip to content

Commit 58f76e5

Browse files
aheevadsharma
authored andcommitted
rename assert macros
1 parent 926dd95 commit 58f76e5

10 files changed

Lines changed: 25 additions & 25 deletions

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-
LBUG_ASSERT(!pyObjects.empty());
25+
DASSERT(!pyObjects.empty());
2626
return pyObjects.back();
2727
}
2828

src_cpp/numpy/numpy_scan.cpp

Lines changed: 7 additions & 7 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-
LBUG_ASSERT(bindData->pandasCol->getBackEnd() == PandasColumnBackend::NUMPY);
25+
DASSERT(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-
LBUG_UNREACHABLE;
29+
UNREACHABLE_CODE;
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-
LBUG_ASSERT(len >= 1);
55+
DASSERT(len >= 1);
5656
utf8StrLen += len;
5757
}
5858
auto& strToAppend = StringVector::reserveString(vectorToAppend, pos, utf8StrLen);
@@ -63,7 +63,7 @@ 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-
LBUG_ASSERT(codePointLen >= 1);
66+
DASSERT(codePointLen >= 1);
6767
dataToWrite += codePointLen;
6868
}
6969
if (!string_t::isShortString(utf8StrLen)) {
@@ -73,7 +73,7 @@ static void appendPythonUnicode(T* codepoints, uint64_t codepointLength,
7373

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

@@ -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-
LBUG_UNREACHABLE;
203+
UNREACHABLE_CODE;
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-
LBUG_UNREACHABLE;
215+
UNREACHABLE_CODE;
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-
LBUG_UNREACHABLE;
86+
UNREACHABLE_CODE;
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-
LBUG_UNREACHABLE;
145+
UNREACHABLE_CODE;
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-
LBUG_UNREACHABLE;
180+
UNREACHABLE_CODE;
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-
LBUG_ASSERT(index < names.size());
29+
DASSERT(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-
LBUG_UNREACHABLE;
31+
UNREACHABLE_CODE;
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-
LBUG_ASSERT(numRows >= scanConfig.skipNum);
42+
DASSERT(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-
LBUG_UNREACHABLE;
71+
UNREACHABLE_CODE;
7272
}
7373
}
7474

src_cpp/py_connection.cpp

Lines changed: 2 additions & 2 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-
LBUG_ASSERT(result->getType() == QueryResultType::FTABLE);
232+
DASSERT(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()) {
@@ -687,7 +687,7 @@ Value PyConnection::transformPythonValueAs(const py::handle& val, const LogicalT
687687
}
688688
// LCOV_EXCL_START
689689
default:
690-
LBUG_UNREACHABLE;
690+
UNREACHABLE_CODE;
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-
LBUG_ASSERT(outputVector->dataType.getLogicalTypeID() == LogicalTypeID::STRUCT);
84+
DASSERT(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-
LBUG_ASSERT(outputVector->dataType.getLogicalTypeID() == LogicalTypeID::MAP);
107+
DASSERT(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-
LBUG_ASSERT(numKeys == py::len(values));
117+
DASSERT(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-
LBUG_UNREACHABLE;
206+
UNREACHABLE_CODE;
207207
}
208208
} break;
209209
default:
210-
LBUG_UNREACHABLE;
210+
UNREACHABLE_CODE;
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-
LBUG_UNREACHABLE;
106+
UNREACHABLE_CODE;
107107
}
108108
}
109109
}
@@ -182,7 +182,7 @@ py::dtype NPArrayWrapper::convertToArrayType(const LogicalType& type) {
182182
dtype = "object";
183183
} break;
184184
default: {
185-
LBUG_UNREACHABLE;
185+
UNREACHABLE_CODE;
186186
}
187187
}
188188
return py::dtype(dtype);

src_cpp/pyarrow/pyarrow_scan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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-
LBUG_UNREACHABLE;
46+
UNREACHABLE_CODE;
4747
}
4848
auto numRows = py::len(table);
4949
auto schema = Pyarrow::bind(table, returnTypes, names);

0 commit comments

Comments
 (0)