-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Floating point numbers seem to always be recorded as changed #56
Comments
I ran a debugger and it looks like one value is a float and the other is as string:
|
The problem is that git-history/git_history/cli.py Lines 430 to 444 in ce9e2f1
And the CREATE TABLE [item_version] (
[_id] INTEGER PRIMARY KEY,
[_item] INTEGER REFERENCES [item]([_id]),
[_version] INTEGER,
[_commit] INTEGER REFERENCES [commits]([id]),
[id] TEXT,
[date] TEXT,
[time] TEXT,
[summary] TEXT,
[category] TEXT,
[location] TEXT,
[latitude] TEXT,
[longitude] TEXT,
[units] TEXT,
[_item_full_hash] TEXT
); |
This seems to fix it: diff --git a/git_history/cli.py b/git_history/cli.py
index f3a4c40..b05d345 100644
--- a/git_history/cli.py
+++ b/git_history/cli.py
@@ -349,7 +349,7 @@ def file(
if column in RESERVED_SET:
continue
value = item_flattened.get(column)
- if value != previous_item.get(column):
+ if str(value) != str(previous_item.get(column)):
updated_values[column] = value
updated_columns.add(column)
else: Needs a test. More importantly though, I don't understand why this database schema has |
In this example:
I don't think
latitude
andlongitude
should be populated as they have not changed between records (unlikeunits
).This is from a demo database built against https://github.com/simonw/scrape-san-mateo-fire-dispatch with:
Relevant code:
git-history/git_history/cli.py
Lines 344 to 354 in ce9e2f1
The text was updated successfully, but these errors were encountered: