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

TST: Check required inplace volumes columns #940

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

mferrera
Copy link
Collaborator

@mferrera mferrera commented Dec 19, 2024

Resolves #928

Caught that HCPV was not set to required in the Pydantic model ✅

Comment on lines +67 to +73
@staticmethod
def required_columns() -> list[str]:
"""Returns a list of the columns required at export."""
return (
InplaceVolumes.required_index_columns()
+ InplaceVolumes.required_value_columns()
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is becoming a kind of verbose "enum". I think it's OK for now, but I can see that the current module/subpackage layout will need adjustment for the next one. It's probably a bit too early to see how that should look now

@mferrera mferrera self-assigned this Dec 19, 2024
@mferrera mferrera requested a review from tnatt December 19, 2024 10:49
@mferrera mferrera marked this pull request as ready for review December 19, 2024 10:49
@@ -34,7 +34,7 @@ class InplaceVolumesResultRow(BaseModel):
BULK: float = Field(ge=0.0)
NET: Optional[float] = Field(default=None, ge=0.0)
PORV: float = Field(ge=0.0)
HCPV: Optional[float] = Field(default=None, ge=0.0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉

@mferrera mferrera force-pushed the check-inplace-vols-required-columns branch from 851fcf4 to e31042e Compare December 20, 2024 11:21
@mferrera mferrera force-pushed the check-inplace-vols-required-columns branch from e31042e to 1f2c116 Compare December 20, 2024 12:22
@mferrera mferrera merged commit 39cbe78 into equinor:main Dec 20, 2024
15 checks passed
@mferrera mferrera deleted the check-inplace-vols-required-columns branch December 20, 2024 12:25
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.

Inplace volumes: assert that required fields at export are required in schema
2 participants