Skip to content

Conversation

@ketan96-m
Copy link
Collaborator

@ketan96-m ketan96-m commented Sep 28, 2024

Problem

Resolve #375

cached_record = (
            self.cache.get_transform_by_hash(sx_request_hash)   # this raises exception when 2 records are present
            if not self.ignore_cache
            else None
        )

When the user submits a transform without ignore-cache -> records are inserted as expected
When the user submits same transform with ignore-cache -> a NEW record is still created (tiny db has no unique value contraints)
When the user submits same tranform without ignore-cache -> 2 records are present hence raises exception

Fix

When the user submits a query and selects ignore_cache -
Check if we have a previous hash already present and if present delete that record since we are going to run the transform again.

@codecov
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.52%. Comparing base (0487232) to head (97dbb29).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #482      +/-   ##
==========================================
+ Coverage   82.89%   83.52%   +0.63%     
==========================================
  Files          26       26              
  Lines        1397     1451      +54     
==========================================
+ Hits         1158     1212      +54     
  Misses        239      239              
Flag Coverage Δ
unittests 83.52% <100.00%> (+0.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ponyisi
Copy link
Collaborator

ponyisi commented Sep 30, 2024

Could you add a test for the specific code path that codecov is complaining about? Then I'll approve

@ketan96-m
Copy link
Collaborator Author

@ponyisi @gordonwatts ready for review
The unit tests were a piece to get it working!

@ketan96-m ketan96-m requested a review from BenGalewsky October 1, 2024 16:23
Copy link
Contributor

@BenGalewsky BenGalewsky left a comment

Choose a reason for hiding this comment

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

ok - thanks for fixing this annoying bug

@BenGalewsky BenGalewsky merged commit 7a65b87 into master Oct 1, 2024
36 checks passed
@BenGalewsky BenGalewsky deleted the cache_collision branch October 1, 2024 16:48
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.

Cache Collisions when you ignore cache for a re-run

5 participants