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] Support constants in expressions #37461

Closed
Tracked by #30513
uladzimirdev opened this issue Jan 9, 2024 · 1 comment · Fixed by #37481
Closed
Tracked by #30513

[MLv2] [BE] [Bug] Support constants in expressions #37461

uladzimirdev opened this issue Jan 9, 2024 · 1 comment · Fixed by #37481
Assignees
Labels
.metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Task Not a part of any Epic, used by the Task Issue Template .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Milestone

Comments

@uladzimirdev
Copy link
Contributor

uladzimirdev commented Jan 9, 2024

Context

Support constants when we add expressions to the query

const constant = 1;
const expressionClause = Lib.expressionClauseForLegacyExpression(query, stageIndex, constant);

const newQuery = Lib.expression(query, stageIndex, "expressionClause", expressionClause)
const expression = Lib.expressions(newQuery, stageIndex)[0]

Lib.legacyExpressionForExpressionClause(query, stageIndex, expression)

// returns ['value', 1, null]

// should be 1

Works fine

const constant = 1;
Lib.legacyExpressionForExpressionClause(query, stageIndex, Lib.expressionClauseForLegacyExpression(query,stageIndex, constant));

// returns 1
@uladzimirdev uladzimirdev added Type:Bug Product defects .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Task Not a part of any Epic, used by the Task Issue Template labels Jan 9, 2024
@uladzimirdev uladzimirdev changed the title [MLv2][BE][Bug] [MLv2][BE][Bug] Support constants in expressions Jan 9, 2024
@ranquild ranquild changed the title [MLv2][BE][Bug] Support constants in expressions [MLv2] [BE] [Bug] Support constants in expressions Jan 9, 2024
@ranquild
Copy link
Contributor

ranquild commented Jan 9, 2024

The user-facing issue is described here #37292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Task Not a part of any Epic, used by the Task Issue Template .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants