Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Expose record_type for responses in graphql #196

Closed
wants to merge 1 commit into from

Conversation

xjules
Copy link
Contributor

@xjules xjules commented Jan 24, 2022

Issue
Relates to equinor/ert#2715

Approach
Expose record_type parameter in graphql and integrate in test.

@xjules xjules self-assigned this Jan 24, 2022
@xjules xjules force-pushed the add_record_type_gql branch 2 times, most recently from 50853fb to d571763 Compare January 25, 2022 08:56
@xjules
Copy link
Contributor Author

xjules commented Jan 25, 2022

Test this please!

@xjules xjules closed this Jan 26, 2022
@xjules xjules reopened this Jan 26, 2022
@@ -73,6 +74,7 @@ def test_get_gql_response(client, create_experiment, create_ensemble):
r = client.gql_execute(GET_UNIQUE_RESPONSES, variable_values={"id": ensemble_id})
for response in r["data"]["ensemble"]["uniqueResponses"]:
assert response["name"] in RESPONSE_NAMES
assert response["recordType"] == "F64_MATRIX"
Copy link
Contributor

Choose a reason for hiding this comment

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

Without knowing the details of how F64_MATRIX is used in ert-storage, I feel like we are leaking implementation details from storage here when we expose the F64_MATRIX as part of the API. Especially in combination with equinor/ert#2782, where we use this information without any abstraction in the engine module.

Also why are we only exposing it through the graphql API? 🤔

Copy link
Contributor Author

@xjules xjules Jan 26, 2022

Choose a reason for hiding this comment

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

Without knowing the details of how F64_MATRIX is used in ert-storage, I feel like we are leaking implementation details from storage here when we expose the F64_MATRIX as part of the API. Especially in combination with equinor/ert#2782, where we use this information without any abstraction in the engine module.

I've created an issue that suggest a better naming of record_types #198

Also why are we only exposing it through the graphql API? 🤔

I agree, but how such a rest endpoint would look like? Are we to support each record in a similar way to /userdata? Graphql provides an easy way to link record_type attribute to each query containing response attribute implicitly...
But we can create an issue on this I think.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also why are we only exposing it through the graphql API? 🤔

We've decided that ERT Storage is a GraphQL API with a REST API only for uploading and downloading records. There is difficulty in implementing this at the moment, however, seeing as it requires simultaneous PRs in ERT and ERT Storage. I have made a PR in ERT asking to put an upper version limit so that this may be implemented: equinor/ert#2815

@xjules xjules force-pushed the add_record_type_gql branch from d571763 to f1b8c61 Compare January 31, 2022 09:22
@xjules
Copy link
Contributor Author

xjules commented Jan 31, 2022

Currently only NumericalRecords are allowed to be responses (ie. active response flag) on the side of ert-storage. Therefore, checking for response record_types prevents any meaningful utilization of the proposed API (at least for the time being).

@xjules
Copy link
Contributor Author

xjules commented Feb 1, 2022

As mentioned above, there is no need to check the type of responses therefore closing this one.

@xjules xjules closed this Feb 1, 2022
@frode-aarstad frode-aarstad deleted the add_record_type_gql branch December 20, 2022 13:37
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