Skip to content
Snippets Groups Projects
Unverified Commit 20d392be authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

MLv2 — Migrate notebook's join step to MLv2 (#33078)


* MLv2 Joins 1 — Basic features (#32903)

* Fix `FilterClause` return type

* Export `Joinable` type

* Add `Join` type to `replaceClause`

* Add `CardDisplayInfo` type

* Add `FilterOperatorDisplayInfo` type

* Add `JoinExternalOp` type

* Export `QueryColumnPickerProps`

* Implement basic MLv2 `JoinStep`

* Remove `null` condition hack

* Sync join strategy on external query update

* Clean `JoinStep.styled.tsx`

* Add `JoinConditionClause` type

* Fix join external op type-casting

* Use HTML button in `JoinTablePicker`

* Simplify `JoinStep` logic

* Add `Join` type to `removeClause`

* Extract `useJoin` hook

* Extract `useJoinCondition` hook

* Group `JoinStep` components into directories

* Fix new condition rendering hack

* Use `cursor: pointer` for join column picker

* Fix condition duplication

* Fix missing LHS/RHS column method arguments

* Simplify join condition assertions

* Fetch metadata for selected table

* Fix `joinConditionLHSColumns` usage

* Highlight selected condition columns

* Preselect right table database, filter databases

* Fix table filter

* Open LHS column picker when table is selected

* Use `joinLHSDisplayName`

* Patch test

* Fix text

* Open RHS column picker once the LHS one is selected

* Preselect models picker for model based questions

* Fix test

* Remove TODOs

* Fix popover ref

* Disallow removing condition columns

* Use "Previous results" if table name is unavailable

* Fix previous results shown too early

* Update `joinLHSDisplayName` usage

* MLv2 Joins 2 — Suggested condition (#32904)

* Use suggested join condition if available

* Remove `it.todo`

* MLv2 Joins 3 — Fields (#32905)

* Update `FieldsPicker` API

* Export `JoinFields` type

* Implement join fields selection

* Fix empty column list when need to fetch metadata

* Add missing tests

* Remove `it.todo`

* Extend tests

* Fix tests

* Fix race-condition when loading table metadata

* Make field picker's `isColumnSelected` required

* MLv2 Joins 4 — Multiple conditions (#32906)

* Implement multiple conditions

* Fix tests

* Remove irrelevant test

* Extract `JoinConditionRightPart`

* Fix temporal units sync for join columns

* MLv2 Joins 5 — Update condition UI (#32907)

* Add `removeCondition` to `useJoin`

* Sync `useJoinCondition` state

* Update join condition UI

* Improve a11y

* Tweak UI

* Fix color literal usage

* Update UI

* Fix read only mode (#32908)

* MLv2 Joins 7 — Fix notebook editor lifecycle issue (#32911)

* Allow keeping a step open on calling `updateQuery`

* Don't auto-close join notebook steps

* Make join steps open by default

* Remove join on table change

* Move open steps calc to `getInitialOpenSteps`

* Remove no longer relevant check

* Add a link to proper fix description

* Use MLv2 in `notebook/lib/steps`

* Update join's `isValid` check

* Remove redundant tests

* Remove more redundant tests

* Revert "Use MLv2 in `notebook/lib/steps`"

This reverts commit 24df2d722282ff1eef60fa45cef4b0e742826d12.

* Revert "Revert "Use MLv2 in `notebook/lib/steps`""

This reverts commit 7b511fd053f59fef2624883c5136a643818e7dee.

* Fix join revert

* Fix type imports linter errors

* MLv2 Joins 8 — Update tests (#32912)

* Use new test IDs

* Update test

Join suggested condition is smarter now and we don't need to manually construct a condition here

* Fix test

* Remove irrelevant test

The behavior used in the repro is removed

* Fix test

Section names used to be inconsistent — mixing singular and plural forms

* Fix test

* Fix fails because of FK name in column names

Normally it's expected to show FK reference names here

It seems like MLv1 just couldn't resolve it through metadata before

* Fix column name

* Fix `JoinStep` tests

* Fix missing FK reference name

* Fix columns highlighting for new condition

* Fix missing FK reference name

* Update E2E tests

MLv2 now figures out suggested conditions in a better way,
and we can skip the manual selection steps now

* MLv2 Joins 9 — Remove `externalOp` usage (#33526)

* Replace `JoinConditionExternalOp` type

* Add `joinConditionParts` helper

* Revert `externalOp` method type definitions

* Don't use `externalOp` for joins

* Fix deselecting all join fields

* Fix test

* Fix tests

* Remove most of MLv1 joins code (#33334)

* Remove join's `clean` method

* Remove join's `hasGaps` method

* Remove join's strategy methods

* Remove join fields method

* Remove join's `addEmptyDimensionsPair` method

* Remove join's `joinDimensionOptions` method

* Remove join's `setJoinSourceTableId` method

* Remove join's alias methods

* Remove join's `setOperator` method

* Remove join's `removeCondition` method

* Remove join's `setDefaultCondition` method

* Remove join's `parentDimensions` method

* Remove join's dimension setter methods

* Remove join's `parentDimensionOptions` method

* Remove join's `isMultipleConditionsJoin` method

* Remove join's `joinDimensions` method

* Clean up the `Join` class

* Remove query's `clearJoins` method

* Add `getQueryStageIndex` method

* Remove query's `hasJoins` method

* Remove query's `addJoin` method

* Mark query's `joinedDimensions` as deprecated

* Mark query's `joins` as deprecated

* Mark query's `join` as deprecated

* Remove join update methods

* Remove join removal methods

* Make `cleanJoins` private

* Remove `Join.unit.spec`

* Return `clearFields` join method

* Fix wrong references

* Revert "Remove join removal methods"

This reverts commit 9ae1e8c503d9b097d073836e7c6530282c6a64fa.

* Revert "Remove join update methods"

This reverts commit de232238bd266ed72a498d0afea3675e609cfae3.

* Mark join methods as deprecated

* Remove tests

* Fix bad reference

* Fix linter error

* Revert #32911 (#34407)

* MLv2 Joins — Disable RHS table changes (#34501)

* Disable RHS table change

* Don't highlight inactive join step cells

* Use `disabled` prop instead of custom styles

* Fix test

* Fix RHS column table names

* Fix column name label

* Don't suggest joining something by its implicitly joinable columns (#34538)

Fixes #34526.

---------

Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
parent 315c9073
No related branches found
No related tags found
No related merge requests found
Showing
with 203 additions and 685 deletions
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