@@ -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 ());
@@ -3342,7 +3332,7 @@ size_t calculateRowSize(py::list& columnNames, SQLUSMALLINT numCols) {
33423332 rowSize += columnSize;
33433333 break ;
33443334 case SQL_SS_TIMESTAMPOFFSET:
3345- rowSize += sizeof (DateTimeOffset); // your custom struct for SQL_C_SS_TIMESTAMPOFFSET
3335+ rowSize += sizeof (DateTimeOffset);
33463336 break ;
33473337 default :
33483338 std::wstring columnName = columnMeta[" ColumnName" ].cast <std::wstring>();
0 commit comments