Skip to content
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

CoverageSqliteData._file_id: use "insert or replace" #723

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Oct 23, 2018

Fixes #702

Copy link

@anarcat anarcat left a comment

Choose a reason for hiding this comment

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

LGTM although I would favor a SQL-only simpler approach, as described.

@codecov-io
Copy link

codecov-io commented Mar 31, 2019

Codecov Report

Merging #723 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #723   +/-   ##
=======================================
  Coverage   90.24%   90.24%           
=======================================
  Files          78       78           
  Lines       10884    10884           
  Branches     1127     1127           
=======================================
  Hits         9822     9822           
  Misses        939      939           
  Partials      123      123
Impacted Files Coverage Δ
coverage/sqldata.py 93.73% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 820b255...54bae02. Read the comment docs.

@blueyed blueyed changed the title CoverageSqliteData._file_id: fall back to SELECT CoverageSqliteData._file_id: use "insert or replace" Mar 31, 2019
If `add` is not True, return None.
"""
if filename not in self._file_map:
if add:
with self._connect() as con:
cur = con.execute("insert into file (path) values (?)", (filename,))
cur = con.execute("insert or replace into file (path) values (?)", (filename,))
Copy link
Owner

Choose a reason for hiding this comment

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

How does this fix relate to #760?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You've made the link.. I guess it can help, but can only say it for #702 (comment) really, although I've not tested the "insert or replace" attempt with that one.

@nedbat nedbat merged commit 7c54226 into nedbat:master Apr 8, 2019
@blueyed blueyed deleted the fix-702 branch April 9, 2019 01:18
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.

4 participants