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

Fix metabase lib returning the string "null" as the drill through value #44234

Merged
merged 8 commits into from
Jun 18, 2024

Conversation

nemanjaglumac
Copy link
Member

@nemanjaglumac nemanjaglumac commented Jun 14, 2024

Fixes #44232

Description

This PR is reusing the technique that already existed, in which we'd check if the :value is a keyword :null and return nil instead. That logic is now encapsulated in a new drill-value->js function.

So after we fixed the :null - > `"null", we're left with one more transformation.

In Clojure, nil is sequable, so it was hitting this condition. So we ended up converting an empty list () into an empty array [] because of this line.

Credits and kudos to @piranha for helping me debug this, and for fixing the latter issue.

How to verify

Follow the repro steps from the original issue and confirm that the value is now a proper JS null.

Checklist

  • Tests have been added/updated to cover changes in this PR

@nemanjaglumac nemanjaglumac added the no-backport Do not backport this PR to any branch label Jun 14, 2024
@nemanjaglumac nemanjaglumac requested review from bshepherdson and a team June 14, 2024 16:54
@nemanjaglumac nemanjaglumac self-assigned this Jun 14, 2024
@piranha piranha force-pushed the fix-string-null-quick-drill branch from c3ce99f to 92a4647 Compare June 17, 2024 13:40
@nemanjaglumac nemanjaglumac marked this pull request as ready for review June 17, 2024 13:57
Copy link

replay-io bot commented Jun 17, 2024

Status In Progress ↗︎ 59 / 60
Commit ba6d5ba
Results
2635 Passed

test/metabase/lib/drill_thru_test.cljc Outdated Show resolved Hide resolved
test/metabase/lib/js_test.cljs Outdated Show resolved Hide resolved
@nemanjaglumac nemanjaglumac merged commit bc78552 into master Jun 18, 2024
112 checks passed
@nemanjaglumac nemanjaglumac deleted the fix-string-null-quick-drill branch June 18, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/QueryingComponents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Value of an empty datetime column is a string "null" instead of an actual null
3 participants