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

Validate content value #371

Merged

Conversation

perolavsvendsen
Copy link
Member

Partly solve #369

fmu-dataio currently allows ExportData to be called without content explicitly set. It will in those cases default to a generic value. However, we do not want those data to be available to any data consumer. Long-term, we will require that the content argument is used. Short-term (this PR), we will not validate documents with the default schema.

This PR includes the whitelisted contents into the schema. It also introduces a test which fails if the list of contents in the code becomes out of synch with the list in the schema.

@@ -61,6 +61,7 @@ def __post_init__(self):
"velocity": None,
"volumes": None,
"volumetrics": None, # or?
"inplace_volumes": None, # or?
Copy link
Member Author

Choose a reason for hiding this comment

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

Included to match the current examples, where this value is used for content.

Copy link
Collaborator

@jcrivenaes jcrivenaes left a comment

Choose a reason for hiding this comment

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

LGTM

tests/test_schema/test_schema_logic.py Show resolved Hide resolved
@perolavsvendsen perolavsvendsen merged commit 8bd0308 into equinor:main Sep 28, 2023
6 checks passed
@perolavsvendsen perolavsvendsen deleted the 369-validate-content-value branch September 28, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants