-
Notifications
You must be signed in to change notification settings - Fork 8
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
Check all columns work with release_type = 'record' (compiled releases) #43
Comments
This came up again when working with the Portugal records dataset - |
The missing release tag was due to #85. However, for a record dataset, the tag will always be In the case of the Portugal records dataset, the logic is:
If not NULL, then what value should there be for release_id for the last two? A record can have many releases, and a compiled release doesn't necessarily need an |
Also, instead of adding a lot of support for looking in a record's compiled release in every query, we should just fix open-contracting/kingfisher-process#63, which would copy a record's Once that's done, we can revert #38 and maybe other occurrences of |
We have just deployed open-contracting/kingfisher-process#63 and now the "compile releases" transform will work with records as well as releases - in light of that, this may need review. |
@duncandewhurst Is there still an issue here? |
@jpmckinney We are having a similar issue when using the Paraguay records scrapper (I open the PR #129) |
@jpmckinney I think this is about the use of the |
Can you provide some minimal data to test with (e.g. not all of Paraguay's data)? Looking at the code in |
I'm not sure. The issue was to check that compiled releases published as part of records were being summarized correctly in all the views tables/columns. It looks like two of the issues I thought were due to the format of the source data ( If someone has time to do some testing that would be great. I collected a sample of the Moldova records data in collection 1389 and generated |
Aha, I think the fix we need to do here is to check all occurrences of Example CASE statement from 002...sql: CREATE VIEW parties_summary AS
SELECT
parties_summary_no_data.*,
CASE WHEN release_type = 'record' THEN
data #> ARRAY['compiledRelease', 'parties', party_index::text]
WHEN release_type = 'embedded_release' THEN
data -> 'releases' -> (mod(parties_summary_no_data.id / 10, 1000000)::integer) -> 'parties' -> party_index::integer
ELSE
data #> ARRAY['parties', party_index::text]
END AS party
FROM
parties_summary_no_data
JOIN data ON data.id = data_id; The occurrences to fix are in 005, 006, 007, and we should review the Update: Alternately, we should join |
|
When working with the Moldova records data, which contains compiled releases, I noticed that the
release_tag
column inviews.release_summary_with_data
is empty.This looks like it is due to the same issue as in #36 - needing to look in
data -> 'compiledRelease' -> 'tag'
rather than justdata -> 'tag'
to populate the column.Can we check that all columns are set up to support compiled releases?
The text was updated successfully, but these errors were encountered: