Skip to content

Fix webhook payload structure handling for project_id extraction and …#877

Merged
makseq merged 1 commit into
HumanSignal:masterfrom
yuka-with-data:fix-webhook-payload-structure
Apr 30, 2026
Merged

Fix webhook payload structure handling for project_id extraction and …#877
makseq merged 1 commit into
HumanSignal:masterfrom
yuka-with-data:fix-webhook-payload-structure

Conversation

@yuka-with-data
Copy link
Copy Markdown
Contributor

Fixes #874

Summary

The current implementation assumes data['annotation']['project'], which can raise a KeyError when annotation is not present in the webhook payload.

According to the webhook documentation, project can be a top-level field.

Changes

  • Safely extract project_id from either annotation.project or top-level project
  • Added pytest to cover missing annotation case

Result

Prevents crash during webhook-triggered training when annotation is absent.

@makseq makseq merged commit 55c5a07 into HumanSignal:master Apr 30, 2026
4 of 6 checks passed
@yuka-with-data yuka-with-data deleted the fix-webhook-payload-structure branch April 30, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

huggingface_ner ML Backend: fit() fails with KeyError 'annotation' for certain webhook payloads

2 participants