Skip to content

Commit de269a3

Browse files
committed
fix: Avoid setting empty tzone attribute
1 parent b36ab35 commit de269a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/transform.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ void duckdb_r_decorate(const LogicalType &type, const SEXP dest, const duckdb::C
221221
case LogicalTypeId::TIMESTAMP_NS:
222222
SET_CLASS(dest, RStrings::get().POSIXct_POSIXt_str);
223223
if (convert_opts.tz_out_convert == ConvertOpts::TzOutConvert::WITH) {
224-
// Conversion can happen here, also useful for ALTREP
225-
Rf_setAttrib(dest, RStrings::get().tzone_sym, StringsToSexp({convert_opts.timezone_out}));
224+
// Attribute added here here, also useful for ALTREP
225+
if (convert_opts.timezone_out == "") {
226+
Rf_setAttrib(dest, RStrings::get().tzone_sym, StringsToSexp({convert_opts.timezone_out}));
227+
}
226228
} else {
227229
// Conversion happens in the R layer
228230
Rf_setAttrib(dest, RStrings::get().tzone_sym, RStrings::get().UTC_str);

0 commit comments

Comments
 (0)