BuildReport

class geodetic_engine.projdb.BuildReport[source]

Bases: object

Provenance for one build, so a result can be traced after the fact.

source

Where the definitions came from: a Georepository base URL, or the path of an OSDU catalogue file.

source_version

The source’s own version, when it states one.

register_versions

Every dataset version the source states, by data source name. A register versions the authority’s own objects and the EPSG dataset it carries separately, and a build is only reproducible against the pair.

cache

What the local response cache contributed, and the versions it had been filled against. Empty when the cache was not used, so a build served from cache is never indistinguishable from a fresh one.

appended

Whether this build added to a database another build had already written, rather than to a fresh copy of the base proj.db. Recorded because it decides what the row counts below are counts of, and because the output then has more than one report describing it.

overwrite_rows

Whether a colliding row of this build’s own authorities was replaced rather than reported as a collision.

identifiers

The identifiers another scheme gives objects, an OSDU record id for one, as this build recorded them: the scheme, how many were recorded and how many of those this build wrote, how many were also written as aliases, every identifier that names nothing in the database and why, and where the source and proj.db disagree about an identified object. Empty for a source that has none.

persistable_references

The OSDU PersistableReference strings this build recorded against record ids: whether recording was enabled, how many are recorded, written and unchanged, how many an earlier build recorded were kept or removed because this catalogue no longer states a usable one, how many came from records whose id names nothing here, every record that states none (missing), every one not recorded because it could not be used and why (invalid), and every one recorded or kept despite a disagreement (warnings). Empty for a source that has none.

overrides

What this build replaced that an earlier build had written, which only an appending build with overwrite_rows does: every object whose definition changed and the columns that did (objects), how many objects were stated exactly as they already were (unchanged), every id that now names a different object or nothing, or changed its inactive flag (identifiers), and every record id whose persistableReference was replaced or removed (persistable_references, persistable_references_removed).

property status: str

failed, passed or not validated.

imported_objects()[source]

The objects this build added, as (table, auth_name, code) triples.

Return type:

list[tuple[str, str, str]]

as_dict()[source]

Return the report with everything that went wrong first.

A report is read when something is missing from the database, so the objects that were not imported, the supersessions that were dropped and the validation outcome come before the inventory of what succeeded.

Return type:

dict[str, Any]

to_json(indent=2)[source]

Serialise the report as JSON, problems first.

Parameters:

indent (int, default: 2) – Spaces per indentation level.

Return type:

str

Returns:

The report from as_dict(), as JSON text.

write(path)[source]

Atomically export the report next to the database it describes.

Parameters:

path (Path) – File to write. It is replaced only once the whole report has been written and synced, so a reader never sees half of one.

Return type:

None

__init__(built_at, proj_version, epsg_version, proj_data_version, database_layout_version, source, source_version, authorities, include_deprecated, base_proj_db, output_db, appended=False, overwrite_rows=False, dry_run=False, register_versions=<factory>, cache=<factory>, rows_by_table=<factory>, imported=<factory>, deprecated_imported=<factory>, skipped=<factory>, supersessions_written=0, supersessions_dropped=<factory>, authority_preferences=<factory>, identifiers=<factory>, persistable_references=<factory>, overrides=<factory>, validation=<factory>)