-
Notifications
You must be signed in to change notification settings - Fork 46
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
Avoid UnknownAttributeReference error by eliminating Array#join #226
base: main
Are you sure you want to change the base?
Avoid UnknownAttributeReference error by eliminating Array#join #226
Conversation
I've continued testing this, and it does not yet fix all cases. This works when processing one record at a time, but when attempting I believe it is this code: def pluck_columns(relation)
if @pluck_columns.size == 1 # only the primary key
column_values = relation.pluck(*@pluck_columns)
return [column_values, column_values]
end
column_values = relation.pluck(*@pluck_columns)
primary_key_index = @primary_key_index || -1
primary_key_values = column_values.map { |values| values[primary_key_index] }
serialize_column_values!(column_values)
[column_values, primary_key_values]
end And using |
Can you share a bit more about the relation you're passing to job-iteration (in |
Sure thing, what is working using the code in this PR, but was not without this change is the following: UPDATE: For clarification, ORIGINAL def collection
return OrdinanceLookup.none unless status.in?(DataSetJobStatus::VALID_STATUSES)
batch = OrdinanceLookupBatch.find_by!(external_identifier: batch_external_identifier)
batch.ordinance_lookups
end What still isn't working is: def collection
return OrdinanceLookup.none unless status.in?(DataSetJobStatus::VALID_STATUSES)
batch = OrdinanceLookupBatch.find_by!(external_identifier: batch_external_identifier)
batch.ordinance_lookups.in_batches
end Perhaps it is that the collection is an association? Do you think it would work to have: batch = OrdinanceLookupBatch.find_by!(external_identifier: batch_external_identifier)
OrdinanceLookup.where(batch: batch) |
We're still seeing this. Any update on a fix? |
It's not entirely clear to me what this fixes. The code in #226 (comment) seems to be for a maintenance task, not a direct job-iteration job. Could you add a test that fails without this change and passes with it? |
12b4526
to
3323ec8
Compare
I have signed the CLA |
3323ec8
to
dd82aca
Compare
dd82aca
to
fba2b54
Compare
No description provided.