Repository navigation
fix(data): keep non-finite attributes from poisoning saved projects #1724
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
Changes from all commits
8ca6845
5f024a5
6944869
51d0a22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1149,7 +1149,7 @@ fn sql_value(v: &Value, ty: FieldType) -> rusqlite::types::Value { | |
| (Value::Float(_), _) => Sql::Null, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GeoPackage export still nulls non-finite numbers silently (pre-existing, but on a line this PR edits).
Suggest counting the nulled values and returning a notice through the export's report, following the same pattern as
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6944869. GeoPackage and GeoJSON exports now count values written as null and publish a translated notice with the count and output path. The regression covers clean and lossy resident and streamed exports. |
||
| (Value::Bool(b), _) => Sql::Integer(i64::from(*b)), | ||
| (Value::Text(s), FieldType::Text) => Sql::Text(s.clone()), | ||
| (v, ty) => match Value::parse(&v.to_string(), ty) { | ||
| (v, ty) => match Value::parse_source(&v.to_string(), ty) { | ||
| Value::Int(x) => Sql::Integer(x), | ||
| Value::Float(x) if x.is_finite() => Sql::Real(x), | ||
| Value::Bool(b) => Sql::Integer(i64::from(b)), | ||
|
|
@@ -1167,7 +1167,7 @@ fn value(v: ValueRef<'_>, ty: FieldType) -> Value { | |
| (ValueRef::Real(f), FieldType::Integer) if f.fract() == 0.0 && f.abs() < 9e15 => Value::Int(f as i64), | ||
| (ValueRef::Real(f), _) => Value::Float(f), | ||
| (ValueRef::Text(t), FieldType::Text) => Value::Text(String::from_utf8_lossy(t).into_owned()), | ||
| (ValueRef::Text(t), ty) => Value::parse(&String::from_utf8_lossy(t), ty), | ||
| (ValueRef::Text(t), ty) => Value::parse_source(&String::from_utf8_lossy(t), ty), | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| (ValueRef::Blob(_), _) => Value::Null, | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.