8000 Refactor transaction enrichment to support batch processing by Shpigford · Pull Request #1803 · maybe-finance/maybe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Refactor transaction enrichment to support batch processing #1803

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

Merged
merged 7 commits into from
Feb 5, 2025

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
Collaborator
@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
Collaborator
@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 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
0