Skip to content

Conversation

@HansKallekleiv
Copy link
Collaborator

To facilitate webviz-4d functionality we switch to POST requests for this data.
This will allow us to fetch the data for multiple/all wells at once.

@HansKallekleiv HansKallekleiv changed the title Use POST requests for perforations, completions and casings SubsurfaceDataApi Use POST requests for perforations, completions and casings from SubsurfaceDataApi Sep 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Switches from GET to POST requests for wellbore perforations, completions, and casings API endpoints to enable fetching data for multiple wellbores simultaneously in support of webviz-4d functionality.

  • Replaces single wellbore UUID parameters with arrays of UUIDs across API endpoints
  • Updates both frontend query hooks and backend service methods to handle multiple wellbores
  • Consolidates backend logic into a generic method for processing wellbore list data

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/src/modules/Intersection/view/hooks/queryHooks.ts Updates query hook to pass wellbore UUID as array instead of single string
frontend/src/api/autogen/types.gen.ts Updates API type definitions to use wellbore_uuids arrays and adds wellbore identifier fields
backend_py/primary/primary/services/ssdl_access/well_access.py Refactors to use POST requests and generic method for handling multiple wellbores
backend_py/primary/primary/services/ssdl_access/types.py Adds wellbore_id and wellbore_uuid fields to data models
backend_py/primary/primary/services/ssdl_access/_ssdl_request.py Introduces unified request handling for both GET and POST methods
backend_py/primary/primary/services/ssdl_access/_ssdl_get_request.py Removes old GET-only request implementation
backend_py/primary/primary/routers/well/schemas.py Adds wellbore identifier fields to schema models
backend_py/primary/primary/routers/well/router.py Updates endpoints to accept arrays of wellbore UUIDs
backend_py/primary/primary/routers/well/converters.py Maps new wellbore identifier fields in converter functions
Comments suppressed due to low confidence (1)

backend_py/primary/primary/services/ssdl_access/_ssdl_request.py:1

  • Debug print statement should be removed from production code. The LOGGER.debug statement on the next line already handles this logging.
import logging

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

wellbore_uuids: List[str] = Query(description="List of wellbore uuids"),
# fmt:on
) -> List[schemas.WellborePerforation]:
"""Get well bore casing for a single well bore"""
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

Function docstring is outdated and incorrect. It should describe getting perforations for multiple wellbores, not 'casing for a single well bore'.

Suggested change
"""Get well bore casing for a single well bore"""
"""Get well bore perforations for multiple wellbores"""

Copilot uses AI. Check for mistakes.
wellbore_uuids: List[str] = Query(description="List of wellbore uuids"),
# fmt:on
) -> List[schemas.WellboreCompletion]:
"""Get well bore completions for a single well bore"""
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

Function docstrings are outdated. These functions now handle multiple wellbores, not a single wellbore.

Suggested change
"""Get well bore completions for a single well bore"""
"""Get wellbore completions for multiple wellbores."""

Copilot uses AI. Check for mistakes.
wellbore_uuids: List[str] = Query(description="List of wellbore uuids"),
# fmt:on
) -> List[schemas.WellboreCasing]:
"""Get well bore casings for a single well bore"""
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

Function docstrings are outdated. These functions now handle multiple wellbores, not a single wellbore.

Suggested change
"""Get well bore casings for a single well bore"""
"""Get wellbore casings for multiple wellbores."""

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@Anders2303 Anders2303 left a comment

Choose a reason for hiding this comment

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

Looks good to me, apart from some comments that could be changed

Comment on lines +33 to +34
# POST requests always return dict, so we can safely cast
return result if isinstance(result, dict) else result[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're not casting here? Is this comment outdated?

Comment on lines 981 to +982
* Get Wellbore Completions
* Get well bore completions for a single well bore
* Get wellbore completions
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now you're just repeating the line, so might as well just remove this line fully (same goes for L:995 and L:1008 too)

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.

2 participants