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

Fix foreign key row reporting and empty table checks #193

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

nickzoic
Copy link
Contributor

@nickzoic nickzoic commented Dec 9, 2016

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.

@nickzoic
Copy link
Contributor Author

nickzoic commented Dec 9, 2016

Ummm, Travis CI doesn't seem to be working again ...

@pezholio
Copy link
Contributor

pezholio commented Dec 9, 2016

Hmmm... That's weird. I can't replicate this locally. Will try and dig in to see what's going on...

Nick Moore and others added 22 commits May 12, 2017 12:24
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
Floppy and others added 11 commits February 4, 2020 15:24
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
Sane file:/// url to absolute path conversion (Thanks @stephent)
@veryrusty
Copy link

Closing this; The :master branch in the remote repo has other changes beyond the original PR.

@veryrusty veryrusty deleted the master branch June 2, 2022 01:25
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.

7 participants