Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
af6cbeb8
Unverified
Commit
af6cbeb8
authored
11 months ago
by
Chris Truter
Committed by
GitHub
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Preserve sign on parenthesized zero floats when parsing (#40309)
parent
18701ae3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/upload/parsing.clj
+2
-1
2 additions, 1 deletion
src/metabase/upload/parsing.clj
test/metabase/upload_test.clj
+5
-5
5 additions, 5 deletions
test/metabase/upload_test.clj
with
7 additions
and
6 deletions
src/metabase/upload/parsing.clj
+
2
−
1
View file @
af6cbeb8
...
...
@@ -153,7 +153,8 @@
:parsed-string
(
.substring
deparenthesized-s
0
parsed-idx
)
:ignored-string
(
.substring
deparenthesized-s
parsed-idx
)}))))
(
if
has-parens?
(
-
parsed-number
)
;; By casting to double we ensure that the sign is preserved for 0.0
(
-
(
double
parsed-number
))
parsed-number
))))
(
defn-
parse-number
...
...
This diff is collapsed.
Click to expand it.
test/metabase/upload_test.clj
+
5
−
5
View file @
af6cbeb8
...
...
@@ -123,11 +123,11 @@
[
"-0,0"
-0.0
float-or-int-type
",."
]
[
"-0,0"
-0.0
float-or-int-type
", "
]
[
"-0.0"
-0.0
float-or-int-type
".’"
]
[
"(0.0)"
0
float-or-int-type
"."
]
;; These values should also be parsed as -0.0
[
"(0.0)"
0
float-or-int-type
".,"
]
;; TODO: Fix this subtle bug in our parser 🥴
[
"(0,0)"
0
float-or-int-type
",."
]
[
"(0,0)"
0
float-or-int-type
", "
]
[
"(0.0)"
0
float-or-int-type
".’"
]
[
"(0.0)"
-0.0
float-or-int-type
"."
]
[
"(0.0)"
-0.0
float-or-int-type
".,"
]
[
"(0,0)"
-0.0
float-or-int-type
",."
]
[
"(0,0)"
-0.0
float-or-int-type
", "
]
[
"(0.0)"
-0.0
float-or-int-type
".’"
]
[
"-4300.00€"
-4300
float-or-int-type
".,"
]
[
"£1,000.00"
1000
float-or-int-type
]
[
"£1,000.00"
1000
float-or-int-type
"."
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment