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

Fix serialization of numpy arrays and pandas dataframes in REST API #2838

Merged
merged 7 commits into from Aug 2, 2022

Conversation

tstadel
Copy link
Member

@tstadel tstadel commented Jul 18, 2022

Related Issue(s):

Proposed changes:

  • use proper json_encoders for numpy arrays and pandas Dataframes
  • get rid of empty DTOs

@tstadel tstadel requested a review from ZanSara July 18, 2022 14:01
Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

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

Wow, elegant fix! Good to go 👍

@tstadel
Copy link
Member Author

tstadel commented Jul 19, 2022

Unfortunately this breaks the feedback get. So even if there's a solution to the"PR stuck" issue I have to fix that before merge.

@ZanSara
Copy link
Contributor

ZanSara commented Jul 19, 2022

Unfortunately this breaks the feedback get. So even if there's a solution to the "PR stuck" issue I have to fix that before merge.

We had no tests for it? Stuff like this makes me wish we had a coverage report somewhere 😕

Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

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

Let's add tests for the GET /feedback endpoint first

@tstadel
Copy link
Member Author

tstadel commented Jul 19, 2022

@ZanSara I added some tests for the search API regarding non primitive types. Feedback API had already some tests. However, the mock never returned any labels and the assertions of the response objects were missing.

@tstadel tstadel requested a review from ZanSara July 19, 2022 17:28
Copy link
Contributor

@ZanSara ZanSara 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, left only a comment for style

rest_api/test/test_rest_api.py Show resolved Hide resolved
@tstadel tstadel marked this pull request as draft August 1, 2022 12:53
@tstadel tstadel marked this pull request as ready for review August 1, 2022 12:53
@tstadel tstadel merged commit 2c56305 into master Aug 2, 2022
@tstadel tstadel deleted the fix_api_np_serialiation branch August 2, 2022 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:rest_api type:bug Something isn't working type:refactor Not necessarily visible to the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants