Skip to content
Snippets Groups Projects
Unverified Commit 590948ab authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Migrate click behavior column computation to MLv2 (#37438)


* Extract click targets for native

* Add checks for mbql queries

* Add isa method

* Update styling

* Add dimensions handling for native questions

* Add a workaround to get proper columns

* [MLv2] Add `legacy-column->metadata` for converting `DatasetColumn`

The query and stage are unfortunately required to correctly handle
aggregation references.

Note that the JS version of this name is `legacy_column__GT_metadata`,
with the double underscore.

* Add TS wrapper

* fixup! Merge remote-tracking branch 'origin/mblib-dataset-column-conv' into click-behavior-draft

* Fix another test

* Fix test

* Use correct query in filtering logic

* Fix typecheck

* Make code cleaner

* Make question a mandatory argument

* Correct types

* oops

* [MLv2] Add `legacy-column->metadata` for converting `DatasetColumn`

The query and stage are unfortunately required to correctly handle
aggregation references.

Note that the JS version of this name is `legacy_column__GT_metadata`,
with the double underscore.

* Add TS wrapper

* [MLv2] Add `compatible-type?` and JS-friendly wrapper

`metabase.lib.types.isa/compatible-type?` returns true if the two
columns belong to the same type family (strings, numbers, temporal) or
the type of one column `isa?` subtype of the other.

The `lib.js/compatible-type?` wrapper can handle JS `DatasetColumn`
values as well as CLJS `:metadata/column` ones.

Fixes #37501. (Unblocks #37328.)

* Give a try assignable

* [MLv2] Add `compatible-type?` and JS-friendly wrapper

`metabase.lib.types.isa/compatible-type?` returns true if the two
columns belong to the same type family (strings, numbers, temporal) or
the type of one column `isa?` subtype of the other.

The `lib.js/compatible-type?` wrapper can handle JS `DatasetColumn`
values as well as CLJS `:metadata/column` ones.

Fixes #37501. (Unblocks #37328.)

* Address recent changes

---------

Co-authored-by: default avatarUladzimir Havenchyk <uladzimir.dev@gmail.com>
Co-authored-by: default avatarUladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: default avatarBraden Shepherdson <braden@metabase.com>
Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
parent 03540497
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment