Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MLv2] [BE] [Bug] legacyRef throws when called for returnedColumns when there is an aggregation #37698

Closed
Tracked by #36108
ranquild opened this issue Jan 15, 2024 · 0 comments · Fixed by #37705
Closed
Tracked by #36108
Assignees
Labels
.Backend .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor :hammer_and_wrench:

Comments

@ranquild
Copy link
Contributor

ranquild commented Jan 15, 2024

Blocks #37171

When there is an aggregation clause in the query, doing

Lib.returnedColumns(query, -1).map(column => Lib.legacyRef(column));

throws an error:
Screenshot 2024-01-15 at 15 49 44

@ranquild ranquild added .Backend .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor :hammer_and_wrench: labels Jan 15, 2024
@metamben metamben self-assigned this Jan 15, 2024
kamilmielnik added a commit that referenced this issue Feb 2, 2024
* Migrate syncStructuredQueryColumnsAndSettings to MLv2

* Migrate syncStructuredQueryColumnsAndSettings to MLv2

* Fix types

* Support converting aggregation references to legacy references

Fixes #37698.

* Update TS wrapper

* Pass query and stageIndex to legacyQuery

* Pass query and stageIndex to legacyQuery

* Remove no longer used columnDimensionWithName

* Update assertion in failing test

* Replace non-existing Question.prototype.isNative & Question.prototype.isStructured calls

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
npfitz pushed a commit that referenced this issue Feb 5, 2024
* Migrate syncStructuredQueryColumnsAndSettings to MLv2

* Migrate syncStructuredQueryColumnsAndSettings to MLv2

* Fix types

* Support converting aggregation references to legacy references

Fixes #37698.

* Update TS wrapper

* Pass query and stageIndex to legacyQuery

* Pass query and stageIndex to legacyQuery

* Remove no longer used columnDimensionWithName

* Update assertion in failing test

* Replace non-existing Question.prototype.isNative & Question.prototype.isStructured calls

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor :hammer_and_wrench:
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants