Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
f9bbbabc
Unverified
Commit
f9bbbabc
authored
1 year ago
by
Alexander Polyankin
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove broken field ref comparison with QP columns (#39517)
parent
944be00c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase-lib/comparison.ts
+2
-6
2 additions, 6 deletions
frontend/src/metabase-lib/comparison.ts
frontend/src/metabase-lib/comparison.unit.spec.ts
+0
-30
0 additions, 30 deletions
frontend/src/metabase-lib/comparison.unit.spec.ts
with
2 additions
and
36 deletions
frontend/src/metabase-lib/comparison.ts
+
2
−
6
View file @
f9bbbabc
import
*
as
ML
from
"
cljs/metabase.lib.js
"
;
import
type
{
DatasetColumn
,
DatasetQuery
,
DimensionReference
,
}
from
"
metabase-types/api
"
;
import
type
{
DatasetQuery
,
DimensionReference
}
from
"
metabase-types/api
"
;
import
type
{
ColumnMetadata
,
Query
}
from
"
./types
"
;
...
...
@@ -27,7 +23,7 @@ export function findMatchingColumn(
export
function
findColumnIndexesFromLegacyRefs
(
query
:
Query
,
stageIndex
:
number
,
columns
:
ColumnMetadata
[]
|
DatasetColumn
[]
,
columns
:
ColumnMetadata
[],
fieldRefs
:
DimensionReference
[],
):
number
[]
{
return
ML
.
find_column_indexes_from_legacy_refs
(
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase-lib/comparison.unit.spec.ts
deleted
100644 → 0
+
0
−
30
View file @
944be00c
import
{
freeze
}
from
"
immer
"
;
import
*
as
Lib
from
"
metabase-lib
"
;
import
{
createQuery
}
from
"
metabase-lib/test-helpers
"
;
import
{
createOrdersTaxDatasetColumn
,
createOrdersTotalDatasetColumn
,
}
from
"
metabase-types/api/mocks/presets
"
;
describe
(
"
findColumnIndexesFromLegacyRefs
"
,
()
=>
{
it
(
"
works even on frozen columns and refs
"
,
()
=>
{
const
query
=
createQuery
();
const
stageIndex
=
-
1
;
const
columns
=
freeze
(
[
createOrdersTotalDatasetColumn
(),
createOrdersTaxDatasetColumn
()],
true
,
);
const
columnIndexes
=
Lib
.
findColumnIndexesFromLegacyRefs
(
query
,
stageIndex
,
columns
,
columns
.
map
(({
field_ref
})
=>
field_ref
!
),
);
expect
(
Object
.
isFrozen
(
columns
[
0
])).
toBe
(
true
);
expect
(
Object
.
isFrozen
(
columns
[
1
])).
toBe
(
true
);
expect
(
columnIndexes
).
toEqual
([
0
,
1
]);
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment