Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

[SCHEMATIC-360] Add script to write jsonschemas to a synapse table#1642

Draft
thomasyu888 wants to merge 6 commits intodevelopfrom
schematic-360-write-to-table
Draft

[SCHEMATIC-360] Add script to write jsonschemas to a synapse table#1642
thomasyu888 wants to merge 6 commits intodevelopfrom
schematic-360-write-to-table

Conversation

@thomasyu888
Copy link
Copy Markdown
Member

Problem:

Currently, we maintain a Confluence page manually with the JSON schemas we generate that can be used for Curator MVP. This won't scale as we create more JSON schemas.

Solution:

Add ad-hoc script to write jsonschemas that DPE generates to a synapse table for Curator MVP. This is partially doing some of schematic-360 work and adds a 'script' directory

Testing:

View Synapse table here: https://www.synapse.org/Synapse:syn69735275/tables/

# exclude HTAN1, HTAN2, and NF schemas as they have their own JSONschema organizations
df = df[~df["dcc"].isin(["htan", "htan2", "nf"])]
table = Table(id="syn69735275").get(include_columns=True)
table.upsert_rows(values=df, primary_keys=["uri"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this upsert functionality getting some use!

@thomasyu888
Copy link
Copy Markdown
Member Author

This could probably be added to the extensions package instead of this repo

Comment thread scripts/write_jsonschemas_to_table.py Outdated
"""
syn = synapseclient.login()
# json_schema_organizations = ["sage.schemas.v2571", "sage.schemas.v2581"]
json_schema_organizations = ["sage.schemas.v2571", "sage.schemas.v2581"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have the orgs as a parameter to the main function so that if/when we add new orgs we wouldn't have to update this?

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants