Skip to content

Commit 978fe43

Browse files
committed
minor cleanup
1 parent aa88cf7 commit 978fe43

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

mssql_python/pybind/ddbc_bindings.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3186,24 +3186,15 @@ SQLRETURN FetchBatchData(SQLHSTMT hStmt, ColumnBuffers& buffers, py::list& colum
31863186
break;
31873187
}
31883188
case SQL_SS_TIMESTAMPOFFSET: {
3189-
// i = current row index in outer loop
31903189
SQLULEN rowIdx = i;
31913190
const DateTimeOffset& dtoValue = buffers.datetimeoffsetBuffers[col - 1][rowIdx];
31923191
SQLLEN indicator = buffers.indicators[col - 1][rowIdx];
3193-
31943192
if (indicator != SQL_NULL_DATA) {
3195-
// Compute total minutes offset
31963193
int totalMinutes = dtoValue.timezone_hour * 60 + dtoValue.timezone_minute;
3197-
3198-
// Import Python datetime module
31993194
py::object datetime = py::module_::import("datetime");
3200-
3201-
// Construct tzinfo object for the original offset
32023195
py::object tzinfo = datetime.attr("timezone")(
32033196
datetime.attr("timedelta")(py::arg("minutes") = totalMinutes)
32043197
);
3205-
3206-
// Construct Python datetime object with tzinfo
32073198
py::object py_dt = datetime.attr("datetime")(
32083199
dtoValue.year,
32093200
dtoValue.month,
@@ -3215,7 +3206,6 @@ SQLRETURN FetchBatchData(SQLHSTMT hStmt, ColumnBuffers& buffers, py::list& colum
32153206
tzinfo
32163207
);
32173208
py_dt = py_dt.attr("astimezone")(datetime.attr("timezone").attr("utc"));
3218-
// Append to row
32193209
row.append(py_dt);
32203210
} else {
32213211
row.append(py::none());

0 commit comments

Comments
 (0)