Skip to content

Commit

Permalink
Got gx validation to work. Had to use mostly=0.5, not ideal
Browse files Browse the repository at this point in the history
  • Loading branch information
Beatriz Saldana committed Dec 6, 2024
1 parent d227ee4 commit 17b6f51
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 21 deletions.
10 changes: 5 additions & 5 deletions gx_suite_definitions/gene_info.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@
"metadata": {},
"outputs": [],
"source": [
"# # druggability\n",
"# validator.expect_column_values_to_be_of_type(\"druggability\", \"str\")\n",
"# with open(\"../src/agoradatatools/great_expectations/gx/json_schemas/gene_info/druggability.json\", \"r\") as file:\n",
"# druggability_schema = json.load(file)\n",
"# validator.expect_column_values_to_match_json_schema(\"druggability\", json_schema=druggability_schema)"
"# druggability\n",
"validator.expect_column_values_to_be_of_type(\"druggability\", \"str\")\n",
"with open(\"../src/agoradatatools/great_expectations/gx/json_schemas/gene_info/druggability.json\", \"r\") as file:\n",
" druggability_schema = json.load(file)\n",
"validator.expect_column_values_to_match_json_schema(\"druggability\", json_schema=druggability_schema, mostly=0.50)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,56 @@
},
"meta": {}
},
{
"expectation_type": "expect_column_values_to_be_of_type",
"kwargs": {
"column": "druggability",
"type_": "str"
},
"meta": {}
},
{
"expectation_type": "expect_column_values_to_match_json_schema",
"kwargs": {
"column": "druggability",
"json_schema": {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"default": null,
"examples": [
{
"pharos_class": [
"Tchem"
]
}
],
"properties": {
"pharos_class": {
"default": [],
"examples": [
[
"Tchem"
]
],
"items": {
"default": "",
"examples": [
"Tchem"
],
"title": "Pharos object",
"type": "string"
},
"title": "The pharos_class Schema",
"type": "array"
}
},
"title": "Root Schema",
"type": "object"
},
"mostly": 0.5
},
"meta": {}
},
{
"expectation_type": "expect_column_values_to_be_of_type",
"kwargs": {
Expand Down Expand Up @@ -453,25 +503,25 @@
"kwargs": {
"column": "biodomains",
"list_members": [
"Cell Cycle",
"Oxidative Stress",
"Synapse",
"Metal Binding and Homeostasis",
"Autophagy",
"Mitochondrial Metabolism",
"Proteostasis",
"RNA Spliceosome",
"APP Metabolism",
"Apoptosis",
"Endolysosome",
"Vasculature",
"Tau Homeostasis",
"RNA Spliceosome",
"Apoptosis",
"DNA Repair",
"Immune Response",
"Lipid Metabolism",
"Tau Homeostasis",
"Myelination",
"Metal Binding and Homeostasis",
"Synapse",
"Epigenetic",
"Immune Response",
"Oxidative Stress",
"Mitochondrial Metabolism",
"Proteostasis",
"Structural Stabilization",
"DNA Repair"
"Cell Cycle"
]
},
"meta": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"default": {},
"default": null,
"title": "Root Schema",
"required": [
"pharos_class"
],
"properties": {
"pharos_class": {
"type": "array",
Expand All @@ -15,7 +12,7 @@
"items": {
"type": "string",
"default": "",
"title": "A Schema",
"title": "Pharos object",
"examples": [
"Tchem"
]
Expand Down

0 comments on commit 17b6f51

Please sign in to comment.