Skip to content
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

BugFix: Fix error when use_annotations=True for record based metadata where there are no existing annotations #1285

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions schematic/manifest/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,16 @@ def get_manifest(
annotations = store.getDatasetAnnotations(dataset_id)
# Update `additional_metadata` and generate manifest
manifest_url, manifest_df = self.get_manifest_with_annotations(annotations,strict=strict)

# If the annotations are empty,
# ie if there are no annotations to pull or annotations were unable to be pulled because the metadata is not file based,
# then create manifest from an empty manifest
if annotations.empty:
empty_manifest_df = self.get_dataframe_by_url(empty_manifest_url)
manifest_df = empty_manifest_df

logger.warning(f"Annotations were not able to be gathered for the given parameters. This manifest will be generated from an empty manifest.")

else:
empty_manifest_df = self.get_dataframe_by_url(empty_manifest_url)
if self.is_file_based:
Expand Down
Loading