Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Refactor transaction enrichment to support batch processing#1803

Merged
Shpigford merged 7 commits intomainfrom
data-enricher-optimization
Feb 5, 2025
Merged

Refactor transaction enrichment to support batch processing#1803
Shpigford merged 7 commits intomainfrom
data-enricher-optimization

Conversation

@Shpigford
Copy link
Member

No description provided.

- Add method to enrich transactions in batches
- Implement job scheduling for unenriched transactions
- Improve logging and error handling for transaction enrichment
@Shpigford Shpigford requested a review from zachgoll February 4, 2025 20:30
- Update queries to explicitly join and reference account_entries and account_transactions tables
- Remove unnecessary name presence check before enrichment
- Improve query precision for unenriched transaction selection
@Shpigford Shpigford requested a review from zachgoll February 5, 2025 01:32
- Refactor database joins to use explicit table references
- Improve query performance for unenriched transaction selection
- Ensure correct table aliasing in enrichment methods
@Shpigford
Copy link
Member Author

@zachgoll let me know how this looks now.

Copy link
Contributor

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

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

Yep, functionality looks good now!

The last thing I'm thinking about here is whether we even need EnrichDataJob anymore. All that job is doing now is:

  1. Calculating the number of batches
  2. Enqueueing the batch jobs

I'm thinking we could get rid of that entirely (the job itself) and do this work directly in account.enrich_data.

So in total, we'd:

  • DELETE account.enrich_data_later method
  • DELETE EnrichDataJob

- Delete EnrichDataJob as it's no longer used
- Remove `enrich_data_later` method from Account model
- Update Account::Syncer to directly call `enrich_data` instead of scheduling a job
@Shpigford
Copy link
Member Author

@zachgoll Good call. Updated. We good to push to production?

Copy link
Contributor

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

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

Yep, looks good!

@Shpigford Shpigford merged commit b84a33c into main Feb 5, 2025
5 checks passed
@Shpigford Shpigford deleted the data-enricher-optimization branch February 5, 2025 16:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants