Report geography no dataset declared - #262
Merged
Merged
Conversation
Nearly every process of some SimaPro databases leaves the Geography
field at "Unspecified" — 20537 of 21510 entries in Agribalyse 3.2 — and
the only geography left is the code inside the dataset name ("… {FR}",
"…//[RER]", "…/CN U"). The parser reads it, which is what makes those
databases usable, but the result is a reading of a name and not a
declaration; an EcoSpold dataset with no geography at all is filled in
with "GLO" just as quietly. Downstream both look like any other
geography, so nothing could tell a maintainer how much of a database's
geography is actually source data.
Activity now carries where its location came from, recorded at parse
time because that is the only place the difference still exists, and the
quality report counts the entries whose geography was not declared. Info
severity: the geography stays usable, and plain absence is still the
missing-metadata warning it was.
The Activity record gained a field in the middle of its Store layout, which is positional: an old cache decoded by this build would misread every field after it, at best failing mid-decode with a misleading "corrupted" message instead of a clean schema-mismatch rebuild. Same situation as salts 9 and 10, same remedy.
The same lookup was written twice, once for the location and once for its source.
The "stands in for it" quality finding was only exercised by building the fixture by hand in QualityReportSpec; nothing proved a real parse of a geography-less dataset produces the GLO stand-in with LocationUnspecified. Two tests pin both sides: a declared geography and the stand-in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Nearly every process of some SimaPro databases leaves the
Geographyfield atUnspecified. On Agribalyse 3.2 that is 20 537 of 21 510 entries: the only geography left is the code inside the dataset name —… {FR},…//[RER],…/CN U. The parser already reads it, which is what makes those databases usable at all, but the result is a reading of a name, not something the source stated. An EcoSpold dataset with no geography is filled in withGLOjust as quietly.Downstream, a declared
FRand a guessedFRare the same text, so nothing could tell a maintainer how much of a database's geography is actually source data. The quality report's existing location check only fires when the geography ends up empty — 16 entries on Agribalyse 3.2 — which reads as "geography is fine" on a database that declares almost none.Final state
Activitycarries where its location came from (LocationDeclared,LocationInferredFromName,LocationUnspecified), recorded at parse time because that is the only place the difference still exists. Each parser fills it in: the geography field when it says something, the name fallback when it doesn't, and neither for a dataset the loader had to supply a stand-in for.The quality report gains an
undeclaredGeographycheck listing every entry whose geography the source never declared, with the reason in the finding. Info severity — the geography stays usable and the numbers stay correct; plain absence is still the missing-metadata warning it always was.Measured on Agribalyse 3.2 (SimaPro CSV, 21 510 entries): 20 521 read off the name, 16 with none at all, 973 actually declared.