Skip to content

Commit 96e19ba

Browse files
committed
fix linter warnings
1 parent 26f0889 commit 96e19ba

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

packages/cubejs-backend-native/js/ResultWrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class ResultWrapper extends BaseWrapper implements DataResult {
5757
const array = this.getArray();
5858
const l = array.length;
5959

60-
return function* () {
60+
return function* yieldArrayItem () {
6161
for (let i = 0; i < l; i++) {
6262
yield array[i];
6363
}

packages/cubejs-backend-native/src/orchestrator.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ pub fn register_module(cx: &mut ModuleContext) -> NeonResult<()> {
3131
Ok(())
3232
}
3333

34-
// #[derive(Debug, Clone)]
35-
// pub enum ResultWrapperData {
36-
// JsObj(RecordBatch),
37-
// Native()
38-
// }
39-
4034
#[derive(Debug, Clone)]
4135
pub struct ResultWrapper {
4236
transform_data: TransformDataRequest,

packages/cubejs-backend-native/test/sql.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as native from '../js';
66
import metaFixture from './meta';
77
import { FakeRowStream } from './response-fake';
88

9-
const logger = jest.fn(({ event }) => {
9+
const _logger = jest.fn(({ event }) => {
1010
if (
1111
!event.error.includes(
1212
'load - strange response, success which contains error'

rust/cubesql/cubesql/src/compile/engine/df/scan.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ pub fn transform_response<V: ValueObject>(
11311131
))
11321132
})?;
11331133
// TODO switch parsing to microseconds
1134-
if timestamp.timestamp_millis() > (((1i64) << 62) / 1_000_000) {
1134+
if timestamp.and_utc().timestamp_millis() > (((1i64) << 62) / 1_000_000) {
11351135
builder.append_null()?;
11361136
} else if let Some(nanos) = timestamp.timestamp_nanos_opt() {
11371137
builder.append_value(nanos)?;
@@ -1173,10 +1173,10 @@ pub fn transform_response<V: ValueObject>(
11731173
))
11741174
})?;
11751175
// TODO switch parsing to microseconds
1176-
if timestamp.timestamp_millis() > (((1 as i64) << 62) / 1_000_000) {
1176+
if timestamp.and_utc().timestamp_millis() > (((1 as i64) << 62) / 1_000_000) {
11771177
builder.append_null()?;
11781178
} else {
1179-
builder.append_value(timestamp.timestamp_millis())?;
1179+
builder.append_value(timestamp.and_utc().timestamp_millis())?;
11801180
}
11811181
},
11821182
},

rust/cubesql/cubesql/src/compile/engine/udf/common.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ pub fn create_date_udf() -> ScalarUDF {
10291029
builder.append_value(
10301030
NaiveDateTime::parse_from_str(strings.value(i), "%Y-%m-%d %H:%M:%S%.f")
10311031
.map_err(|e| DataFusionError::Execution(e.to_string()))?
1032+
.and_utc()
10321033
.timestamp_nanos_opt()
10331034
.unwrap(),
10341035
)?;
@@ -1233,6 +1234,7 @@ macro_rules! date_math_udf {
12331234
let interval = intervals.value(i).into();
12341235
builder.append_value(
12351236
$FUN(timestamp, interval, $IS_ADD)?
1237+
.and_utc()
12361238
.timestamp_nanos_opt()
12371239
.unwrap(),
12381240
)?;
@@ -1572,7 +1574,7 @@ pub fn create_str_to_date_udf() -> ScalarUDF {
15721574
})?;
15731575

15741576
Ok(ColumnarValue::Scalar(ScalarValue::TimestampNanosecond(
1575-
Some(res.timestamp_nanos_opt().unwrap()),
1577+
Some(res.and_utc().timestamp_nanos_opt().unwrap()),
15761578
None,
15771579
)))
15781580
});
@@ -2345,7 +2347,7 @@ macro_rules! generate_series_helper_timestamp {
23452347
))
23462348
})?;
23472349
let res = date_addsub_month_day_nano(current_dt, $STEP, true)?;
2348-
$CURRENT = res.timestamp_nanos_opt().unwrap() as $PRIMITIVE_TYPE;
2350+
$CURRENT = res.and_utc().timestamp_nanos_opt().unwrap() as $PRIMITIVE_TYPE;
23492351
};
23502352
}
23512353

@@ -3230,6 +3232,7 @@ pub fn create_date_to_timestamp_udf() -> ScalarUDF {
32303232
)?;
32313233
Ok(Some(
32323234
NaiveDateTime::new(date, time)
3235+
.and_utc()
32333236
.timestamp_nanos_opt()
32343237
.unwrap(),
32353238
))

rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4117,8 +4117,8 @@ impl FilterRules {
41174117
};
41184118

41194119
let (Some(start_date), Some(end_date)) = (
4120-
start_date.timestamp_nanos_opt(),
4121-
end_date.timestamp_nanos_opt(),
4120+
start_date.and_utc().timestamp_nanos_opt(),
4121+
end_date.and_utc().timestamp_nanos_opt(),
41224122
) else {
41234123
return false;
41244124
};

0 commit comments

Comments
 (0)