Adds a StagedAnnotation class that can be spawned from tables or schema names via client.annotation.stage_annotations("my_table_name"). This class helps produce, validate, and upload annotations.
Annotations are staged by using the add function to add to the class.
This adds an id field that is required to be an int. Adding an id field to new annotations can be accomplished by setting id_field=True when creating the stage object.
After staging annotations based on a table name, they can be uploaded with:
which uses the table name and update Boolean to determine where to send the annotations and whether to use post_annotations or update_annotations.
Staged annotations can be seen with stage.annotation_list or stage.annotation_dataframe.
Additionally, spatial point resolution can be specified on both the table (retrieved automatically) and annotation addition side of things, to avoid having to double check potential mismatches.
Tests on the annotation client are also included which effectively cover posting and updating annotations as well as getting table metadata.
Adds a StagedAnnotation class that can be spawned from tables or schema names via
client.annotation.stage_annotations("my_table_name")
. This class helps produce, validate, and upload annotations.Annotations are staged by using the
add
function to add to the class.Each annotation is validated via JSONschema on adding.
If the annotations to be staged are updates instead of new annotations, the
update=True
flag can be set:This adds an
id
field that is required to be an int. Adding an id field to new annotations can be accomplished by settingid_field=True
when creating the stage object.After staging annotations based on a table name, they can be uploaded with:
which uses the table name and update Boolean to determine where to send the annotations and whether to use
post_annotations
orupdate_annotations
.Staged annotations can be seen with
stage.annotation_list
orstage.annotation_dataframe
.Additionally, spatial point resolution can be specified on both the table (retrieved automatically) and annotation addition side of things, to avoid having to double check potential mismatches.
Tests on the annotation client are also included which effectively cover posting and updating annotations as well as getting table metadata.