Closed yolile closed 5 years ago
If you run flake8
locally, you won't have to wait for Travis :)
I know the except Exception: pass
blocks were present in the original scripts, but we shouldn't ignore all exceptions like that. There are also a variety of other code and style issues, repetitions, etc. from Tim's original version.
Can you:
tests/fixtures
instead of using very long stringsupgrade
, and have it take a required argument which should be two OCDS versions as a colon-separated list, e.g. 1.0:1.1
. In future, we'd add support for upgrading between other versions.@jpmckinney I made the requested changes, but the tests are failing due to a pytest version issue
Thanks! I fixed the build. I'll review PR shortly.
@duncandewhurst Do you have an idea why the old code considered two organizations whose only difference was a contact point to be different organizations? I don't see why that should be the case.
Note: Versioned releases within a record package are not upgraded.
Note: The upgrade can lead to information loss if the same organization has a different address
, contactPoint
, or additionalIdentifiers
across occurrences. The code warns in such cases.
Moved upgrade functions to new file, and:
Do you have an idea why the old code considered two organizations whose only difference was a contact point to be different organizations? I don't see why that should be the case.
My guess is that this is due to the guidance in organization section of the release reference, which states:
If a contracting process represents a contract arranged by the department or branch of a larger organization, the legal entity (usually the registered organization) should be described in the identifier section, with details of the branch or department given in the name, address and contact point as relevant.
Presumably to address the case where the procuring entity and the buyer are different departments of the same legal entity.
The guidance on constructing the party id
is in line with this, though not reflected in the code (since there isn't a department id field in OCDS):
The ID used for cross-referencing to this party from other sections of the release. This field may be built with the following structure {identifier.scheme}-{identifier.id}(-{department-identifier}).
Thanks, @duncandewhurst ! I've changed the code to also use address
and contactPoint
to identify the organization, if present.
@yolile Please review and merge if you see no issues.
https://github.com/open-contracting/kingfisher/issues/256
closes #77