-
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
Fix/obs unit db ids #72
base: master
Are you sure you want to change the base?
Conversation
…ationUnit documents (still observationVariableDbId). fix GNP-6529
…ing a stack for handling data structures values. fix GNP-6529
…api-etl-faidare into fix/obsUnit-DbIds
removing extra deprecated modules and files. Pipfile is now the reference, no more Requirements.txt
Feat/upgrade to python3.12
Feat/upgrade to python3.12
…to expected output. GNP-6543
Add the make_hashable method to resolve unhashable type error
if document_type != "observationVariable": | ||
document[document_type + 'DbId'] = get_generated_uri_from_dict(source, document_type, document, True) | ||
# transform other DbIds , skip observationVariable | ||
# create a stack for the current document | ||
stackDocument = [document] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stackDocument is slightly misleading. Rename for isntance to "stackDocumentFields" or "stackDocumentProperties"
True) | ||
while stackDocument: | ||
# Retrieve the top item of the stack | ||
currentItem = stackDocument.pop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same: currentDocumentItem or currentDocumentField
currentItem = stackDocument.pop() | ||
|
||
if isinstance(currentItem, dict): | ||
for key, value in list(currentItem.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same: replace key with "fieldKey" or "fieldName" or something like that
replace value with "fieldValue" or something like that
@@ -2,8 +2,16 @@ | |||
from etl.transform.utils import get_generated_uri_from_str | |||
|
|||
|
|||
def make_hashable(obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment explaining the origin of this method: synonyms were either list(string) or list(obj) which generate hash error. This methods solv the problem but the real problem was the data model that had changed.
@@ -51,11 +48,11 @@ def handler(*_): | |||
if 'transform_rdf' in options or 'etl_virtuoso' in options: | |||
etl.transform.rdf.main(config) | |||
|
|||
if 'load_elasticsearch' in options or 'etl_es' in options: | |||
etl.load.elasticsearch.main(config) | |||
#if 'load_elasticsearch' in options or 'etl_es' in options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those can be deleted
No description provided.