@@ -476,8 +476,8 @@ export class BaseQuery {
476
476
}
477
477
478
478
newDimension ( dimensionPath ) {
479
- if ( dimensionPath instanceof String || typeof dimensionPath === 'string' ) {
480
- const memberArr = Array . isArray ( dimensionPath ) ? dimensionPath : dimensionPath . split ( '.' ) ;
479
+ if ( typeof dimensionPath === 'string' ) {
480
+ const memberArr = dimensionPath . split ( '.' ) ;
481
481
if ( memberArr . length > 3 &&
482
482
memberArr [ memberArr . length - 2 ] === 'granularities' &&
483
483
this . cubeEvaluator . isDimension ( memberArr . slice ( 0 , - 2 ) ) ) {
@@ -660,10 +660,8 @@ export class BaseQuery {
660
660
if ( ! this . canUseNativeSqlPlannerPreAggregation ) {
661
661
if ( this . options . preAggregationQuery ) {
662
662
isRelatedToPreAggregation = true ;
663
- } else if ( ! this . options . disableExternalPreAggregations && this . externalQueryClass ) {
664
- if ( this . externalPreAggregationQuery ( ) ) {
665
- isRelatedToPreAggregation = true ;
666
- }
663
+ } else if ( ! this . options . disableExternalPreAggregations && this . externalQueryClass && this . externalPreAggregationQuery ( ) ) {
664
+ isRelatedToPreAggregation = true ;
667
665
} else {
668
666
let preAggForQuery =
669
667
this . preAggregations . findPreAggregationForQuery ( ) ;
@@ -782,7 +780,7 @@ export class BaseQuery {
782
780
const buildResult = nativeBuildSqlAndParams ( queryParams ) ;
783
781
784
782
if ( buildResult . error ) {
785
- if ( buildResult . error . cause && buildResult . error . cause === 'User' ) {
783
+ if ( buildResult . error . cause === 'User' ) {
786
784
throw new UserError ( buildResult . error . message ) ;
787
785
} else {
788
786
throw new Error ( buildResult . error . message ) ;
0 commit comments