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

Modify how Python dicts and lists get stored and read into/from Neo4j #621

Open
3 tasks done
maxsibilla opened this issue Feb 11, 2025 · 0 comments
Open
3 tasks done
Assignees

Comments

@maxsibilla
Copy link
Contributor

maxsibilla commented Feb 11, 2025

Currently we are storing a stringified Python literal into Neo4j rather than actual JSON.

  • Modify _build_properties_map in both schema_neo4j_queries.py and app_neo4j_queries.py to replace
 escaped_str = str(value).replace("'", r"\'")

with

escaped_str = json.dumps(value)
  • Write a new method that replaces hubmap_commons.convert_str_literal to utilize json.loads(...) instead of ast.literal_eval(...) as the data being grabbed out of Neo4j will no longer be Python literals

  • In any normalize function such as normalize_entity_result_for_response and _normalize_metadata where hubmap_commons.convert_str_literal is called we will want to replace with the new function mentioned above

@maxsibilla maxsibilla added this to CODCC Feb 11, 2025
@maxsibilla maxsibilla converted this from a draft issue Feb 11, 2025
libpitt added a commit that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants