Validate a Geolocation history export
Practice validating an authorized location-history CSV, testing failure paths and handing an IT owner a minimized, reproducible result.
Validate a Geolocation history export
Build a repeatable, local check for a device-history CSV and give an IT administrator a minimized result they can interpret. You will validate the exported schema, select a UTC investigation window and test failure paths before treating the output as usable evidence.
This exercise is for a developer supporting a company-device workflow, such as an analyst reviewing a shared warehouse tablet after a shift handoff. The developer owns parsing and reproducibility. The authorized IT response owner owns the collection scope, uncertainty assessment and next operational action.
What you will learn
- Validate the documented five-column CSV without inventing API fields.
- Keep recorded-position time separate from a request acknowledgment or device-response receipt.
- Apply a local UTC window and retain unknown accuracy as unknown.
- Reject malformed input without publishing partial results or exposing location values in errors.
- Explain what a passing validation does and does not establish.
Prepare an authorized exercise file
Use a maintained Python 3 installation and an approved local workspace. Obtain a CSV for a company device you are authorized to investigate, or use an explicitly identified illustrative exercise file. Do not change ownership, enrollment or permissions simply to expose an export control.
Before downloading, record the device reference, case owner, permitted time window and file-handling rules. In the device's Location view, review Location history and Export. CSV and XLSX are separate file formats; this exercise uses CSV.
The documented export contains full retained device history, not just the page or row visible on screen. Confirm the actual headers and export scope in your deployed version. The public Trio OpenAPI reference currently contains no documented Geolocation endpoint; an authorized file export is the input for this exercise.
1. Establish the schema and UTC window
Open the canonical Geolocation export validation guide. Check its five exact headers against your file: Recorded At (UTC), Latitude, Longitude, Accuracy (m) and Address. Stop on a mismatch rather than renaming unfamiliar fields to make an importer run.
Choose an inclusive UTC start and exclusive UTC end. Explain why an observation exactly at the end belongs in the next window. If the incident was reported in local time, document the conversion before running the check; do not append Z to an unconverted local timestamp.
Checkpoint: you can name the device and owner, show the matching header and explain both boundaries without treating the selected screen page as the export scope.
2. Produce a minimized result
Copy the complete Python validator from the canonical guide into your local workspace. Keep its code revision with the exercise record. Run it on history.csv with your approved --start and --end values and write its JSON output to a restricted summary file.
Inspect the total validated record count, selected count, known versus unknown accuracy count and selected position-time bounds. The checked illustrative 48-record file yields five selected records for the guide's example date window. That is an exercise result, not an expected count for every export.
Check that the output contains no coordinates or addresses. A supplied accuracy of zero is not the same as a blank value, and decimal coordinate precision does not prove measurement accuracy. The script validates all records before finishing; it does not silently ignore invalid rows outside your selected window.
3. Exercise the failure paths on private copies
Keep the original unchanged. Create separate local test copies and perform these checks:
- Replace one latitude with
NaN. Validation must stop, including when that row falls outside the selected window. A partial summary must not appear. - Leave one accuracy cell and address blank. A structurally valid row must remain valid, and missing accuracy must be counted as unknown.
- Remove the UTC indication from one timestamp. Validation must stop instead of assuming the workstation's time zone.
- Add a
Sourceheader or an extra row value. Schema validation must stop. Do not fill an invented sensor value into other rows. - Choose a valid window with no matching records. Expect a valid empty selection and explain why this is not proof that the device never moved or never reported.
For a local byte or row guard, review the processing requirement rather than dropping data. These guards belong to the example, not the product's retention or export limits.
4. Hand off an interpretation
Give the IT owner the minimized summary, UTC window, protected device reference, file checksum and importer revision. Keep location values out of general tickets and public repositories. Remove temporary exercise copies under the agreed disposal policy.
Explain that this file describes recorded positions. It does not establish the full Locate now lifecycle, a separate receipt timestamp, a geofence crossing or notification delivery. An unchanged recorded-position timestamp alone does not prove that a device failed to answer. The owner should use the relevant product state and available observations for that decision.
Completion rubric
| Criterion | Evidence to retain |
|---|---|
| Authorized scope | Device reference, case owner and approved file handling. |
| Reproducible processing | Original checksum, importer revision, exact UTC boundaries and a successful complete-file validation. |
| Safe failures | The invalid-number, timestamp and schema cases stop without a partial summary or location values in error output. |
| Correct interpretation | Unknown accuracy stays unknown; empty selection and unchanged position time are explained without unsupported conclusions. |
| Data minimization | The handoff uses counts and time bounds; raw coordinates and addresses remain restricted. |
If any criterion fails, stop the integration handoff and resolve that gap with the responsible administrator or integration owner. Continue with Geolocation availability and data for field semantics, or Export a device's location history for the task-focused product steps.
