mirror of
https://github.com/apache/superset.git
synced 2026-05-31 13:19:23 +00:00
chore(deps-dev): bump oxlint from 1.48.0 to 1.49.0 in /superset-frontend (#38115)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
@@ -87,33 +87,6 @@ function inferSqlExpressionAggregate(
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapter function to create an AdhocMetric instance from a core AdhocMetric type.
|
||||
* This bridges the type gap between @superset-ui/core's AdhocMetric and the local class.
|
||||
*/
|
||||
export function fromCoreAdhocMetric(metric: CoreAdhocMetric): AdhocMetric {
|
||||
return new AdhocMetric(metric as AdhocMetricInput);
|
||||
}
|
||||
|
||||
/**
|
||||
* Type guard to check if an object can be used to construct an AdhocMetric.
|
||||
* Returns true for plain objects that have metric-like properties.
|
||||
*/
|
||||
export function isDictionaryForAdhocMetric(
|
||||
value: unknown,
|
||||
): value is AdhocMetricInput {
|
||||
return (
|
||||
typeof value === 'object' &&
|
||||
value !== null &&
|
||||
!(value instanceof AdhocMetric) &&
|
||||
('expressionType' in value ||
|
||||
'column' in value ||
|
||||
'aggregate' in value ||
|
||||
'sqlExpression' in value ||
|
||||
'metric_name' in value)
|
||||
);
|
||||
}
|
||||
|
||||
export default class AdhocMetric {
|
||||
expressionType: string;
|
||||
column?: ColumnType | null;
|
||||
@@ -224,3 +197,30 @@ export default class AdhocMetric {
|
||||
return inferSqlExpressionColumn(this as unknown as AdhocMetricInput);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Type guard to check if an object can be used to construct an AdhocMetric.
|
||||
* Returns true for plain objects that have metric-like properties.
|
||||
*/
|
||||
export function isDictionaryForAdhocMetric(
|
||||
value: unknown,
|
||||
): value is AdhocMetricInput {
|
||||
return (
|
||||
typeof value === 'object' &&
|
||||
value !== null &&
|
||||
!(value instanceof AdhocMetric) &&
|
||||
('expressionType' in value ||
|
||||
'column' in value ||
|
||||
'aggregate' in value ||
|
||||
'sqlExpression' in value ||
|
||||
'metric_name' in value)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapter function to create an AdhocMetric instance from a core AdhocMetric type.
|
||||
* This bridges the type gap between @superset-ui/core's AdhocMetric and the local class.
|
||||
*/
|
||||
export function fromCoreAdhocMetric(metric: CoreAdhocMetric): AdhocMetric {
|
||||
return new AdhocMetric(metric as AdhocMetricInput);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user