Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • Wellbore Domain Services Wellbore Domain Services
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Open Subsurface Data Universe Software
  • Platform
  • Domain Data Mgmt Services
  • Wellbore
  • Wellbore Domain ServicesWellbore Domain Services
  • Merge requests
  • !105

Merged
Created May 25, 2021 by Yannick@VernetMaintainer

fix double json (de)serialisation

  • Overview 2
  • Commits 2
  • Pipelines 6
  • Changes 2

There was a double json deserialisation in chunking feature when dealing with json format. In ddms_v3_utils.py/DMSV3RouterUtils.get_df_from_request in case on json format, it did that:

content = await request.json()
...
return DataframeSerializer.read_json(content, orient)

both line did a json deserialisation. Fix done by directly getting raw body from the request await request.body() instead of await request.json()

Unfortunately there was also a double serialisation in the tests as well hidding this bug. Tests are doing stuff like that:

client.post(url, json=chunk_dataframe.to_json(orient='split'))

chunk_dataframe.to_json performs a first json serialisation. But passing data using 'json' keyword in the post method performs also a json serialisation. Fix by using 'data' instead:

client.post(url, data=chunk_dataframe.to_json(orient='split'))
Edited May 25, 2021 by Yannick
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: bug/chunking_json_422