-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix foreign key row reporting and empty table checks #193
Open
nickzoic
wants to merge
38
commits into
Data-Liberation-Front:main
Choose a base branch
from
logicly-au:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ummm, Travis CI doesn't seem to be working again ... |
Hmmm... That's weird. I can't replicate this locally. Will try and dig in to see what's going on... |
They've already been validated. Not sure if this will work.
It's not as simple as just looking for arrays, since we are dealing with possibly multi-column keys, they are all arrays. This change means if we have "5 7 9" as the column, then it's as if we had three separate rows with "5", "7", and "9". The checking code now does not need to change.
Allow array values with individual foreign key checks
Return [] not nil for empty array values
I'm not quite sure what's causing this, but when we delete rows with array values in them, we get errors on the empty rows, because we're trying to iterate a list which is actually nil. I suspect this is a side-effect of interpreting empty array values as [], not nil.
…-values Don't iterate array values if nil
Add script to build the gemfile using docker
headtohelp spec allows a 24 hour time, without the leading zero before 10am. All the existing time formats require a two digit hour. Add support for the time format `H:mm` with optional leading zero.
* Supports time format `H:mm`
This handles converting from file.csv to file:///full/path/to/file.csv and back again. This logic was sprinkled about, and not always correct.
We always want to File.new it
Fix filename urls
Sane file:/// url to absolute path conversion (Thanks @stephent)
Closing this; The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix foreign key row reporting
My previous PR added a 'row' to the FK error, but it turned out to be wrong in many cases as it was actually a count of how many unique FK refs there were: this version generates a separate error record per FK violation and thus gives better feedback. To do this is keeps a list of all rows which use a foreign key, which will use slightly more memory than before, but it also uses a hash to store the known values which should be somewhat quicker.
Run FK checks even if a table is empty
Previously, if any tables were empty (eg: a header but 0 rows) they wouldn't be marked as "valid" internally, so FK checks would not run. This PR fixes that by marking an empty table with a valid header as valid. This was originally PR #190 but these issues are entangled so I'm closing that one and submitting this merged PR.