-
Notifications
You must be signed in to change notification settings - Fork 26
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
[FDS-1797] input graph api #1481
base: develop
Are you sure you want to change the base?
Conversation
…gic in the CLI function
…th is pickle. Also test both parameters are empty.
…onetworks/schematic into FDS-1797-input-graph-api
tests/test_cli.py
Outdated
def test_schema_convert_cli(self, runner, output_path, output_type): | ||
model = "tests/data/example.model.csv" | ||
label_type = "class_label" | ||
expected = 0 | ||
|
||
output_path = helpers.get_data_path("example.model.jsonld") | ||
resultOne = runner.invoke(schema, ["convert", model]) | ||
|
||
label_type = "class_label" | ||
assert resultOne.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) | ||
|
||
resultTwo = runner.invoke( | ||
schema, ["convert", model, "--output_path", output_path] | ||
) | ||
|
||
assert resultTwo.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) | ||
|
||
resultThree = runner.invoke( | ||
schema, ["convert", model, "--output_type", output_type] | ||
) | ||
|
||
assert resultThree.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) | ||
|
||
resultFour = runner.invoke( | ||
schema, | ||
[ | ||
"convert", | ||
model, | ||
"--output_type", | ||
output_type, | ||
"--output_jsonld", | ||
output_path, | ||
], | ||
) | ||
|
||
assert resultFour.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) | ||
|
||
result = runner.invoke( | ||
schema, | ||
[ | ||
"convert", | ||
data_model_csv_path, | ||
model, | ||
"--output_jsonld", | ||
output_path, | ||
"--data_model_labels", | ||
label_type, | ||
], | ||
) | ||
|
||
assert result.exit_code == 0 | ||
assert result.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) | ||
|
||
expected_substr = ( | ||
"The Data Model was created and saved to " f"'{output_path}' location." | ||
resultFive = runner.invoke( | ||
schema, | ||
[ | ||
"convert", | ||
model, | ||
"--output_jsonld", | ||
"tests/data/example.model.pickle", | ||
"--output_path", | ||
"tests/data/example.model.pickle", | ||
], | ||
) | ||
|
||
assert expected_substr in result.output | ||
assert resultFive.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) | ||
|
||
resultSix = runner.invoke( | ||
schema, ["convert", model, "--output_jsonld", "", "--output_path", ""] | ||
) | ||
|
||
assert resultSix.exit_code == expected | ||
# check output_path file is created then remove it | ||
assert os.path.exists(output_path) |
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.
- 1 to Tom's suggestion. Please split this up so that it is more clear what has been tested.
Quality Gate passedIssues Measures |
@afwillia another concern that I have about the PR is that I am seeing a lot of:
and also a lot of classes have both Here's an example of what I meant: #1499 |
@afwillia another point is that if you change parameter |
Quality Gate passedIssues Measures |
Just taking a note here, sophia will reach out to discuss the PR/state of this feature at large prior to merge. Thanks for all the work! |
This PR adds a
graph_url
parameter to the manifest/generate, validate, and submit API endpoints.graph_url
is a URL to a pickled data model graph. Supplying it should make the request run faster. It depends on PR1425 and PR1396 which I have already merged into this branch to facilitate development.graph_url
will be added to other endpoints that also acceptschema_url
, but the three endpoints above are the most relevant to DCA and the current improvement sprint.Linking #1425 , #1396