Skip to content

hotfix - #62

Merged
TPKutch merged 4 commits into
developmentfrom
development-oura-webhook
May 21, 2026
Merged

hotfix#62
TPKutch merged 4 commits into
developmentfrom
development-oura-webhook

Conversation

@TPKutch

@TPKutch TPKutch commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

fix inconsistent filename handling in webhook_times

@TPKutch
TPKutch requested a review from TomekFraczek April 21, 2026 14:08
@TPKutch

TPKutch commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator Author

small fixes that will 1) make the json uploader robust to missing document ids, 2) have oura parser record webhook event times in CST for interpretability, 3) fix accidental '.json.json' at the end of webhook time files

@TPKutch
TPKutch marked this pull request as draft April 23, 2026 15:56
@TPKutch
TPKutch marked this pull request as ready for review May 14, 2026 19:45

@TomekFraczek TomekFraczek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly really nice, but I'm a bit confused about what you're doing with the document_ids

Comment thread source/uploaders/json.py Outdated
Comment on lines +91 to +94
this_id = doc.get(self.target_location['doc_id_key'])
if this_id is None:
self.warning(f"Skipping existing record without {self.target_location['doc_id_key']} in {target_file}")
continue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What types of data don't have doc ids?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was encountering problems where the doc id was named incorrectly, but yeah I think this can be deleted. was mostly for debugging.

"doc_type": self.event_track_datatype, # "webhook_times"
"date": payload_out["date"], # same day grouping
"document_id": timestamp_clean, # unique per webhook file (good enough)
"id": f"{object_id}_{event_time_local}", # unique per webhook file (good enough)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not still need a document ID to uniquely identify the data file you're trying to fetch from Oura

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i'm just changing the name from document_id to id to make it consistent across oura documents, and I'm making it more unique. before it was causing problems

@TomekFraczek TomekFraczek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for explaining things!

@TPKutch
TPKutch merged commit 5aeda2f into development May 21, 2026
1 check failed
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.

2 participants