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(datasets): do not double encode the data as json when saving an A… #301

Merged
merged 3 commits into from
Aug 15, 2023

Conversation

FlorianGD
Copy link
Contributor

APIDataSet

Description

When saving an APIDataSet, the data was doubly encoded as json (making it a string instead of a dict for example), once by us and once by the requests library. This PR fixes that.

Development notes

The json parameter of requests.request is now a python object instead of a string. The tests have been updated to catch the problem.

Checklist

  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the relevant RELEASE.md file
  • Added tests to cover my changes

@noklam
Copy link
Contributor

noklam commented Aug 10, 2023

Thanks @FlorianGD Is this a bug or it has been always like this? I suspect this is introduced in #180. Is it only affecting load method? since save was only added recently I assume this doesn't affect load

CC @McDonnellJoseph

@noklam
Copy link
Contributor

noklam commented Aug 10, 2023

This looks like a good fix to me. Thanks @FlorianGD

Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

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

Thank you! @FlorianGD

FlorianGD and others added 2 commits August 10, 2023 17:57
…PIDataSet

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
@noklam noklam mentioned this pull request Aug 15, 2023
4 tasks
@noklam noklam merged commit fdd6073 into kedro-org:main Aug 15, 2023
14 checks passed
lrcouto pushed a commit that referenced this pull request Aug 15, 2023
#301)

* fix(datasets): do not double encode the data as json when saving an APIDataSet

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

* chore(lint): make pyling happy

Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

---------

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Co-authored-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>
lrcouto added a commit that referenced this pull request Aug 24, 2023
* Add CONTRIBUTING.md file to the Kedro-Plugins repository

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* fix(datasets): Correct pyproject.toml syntax for optional dependencies (#302)

* Fix pyproject.toml syntax for optional dependencies

Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>

* refacor out the base dependencies

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* add comments

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* format pyproject.toml

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* Reorder pandas dependencies

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* reorder spark dependencies

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* remove polars-base and delta-base

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

---------

Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Co-authored-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Bring CONTRIBUTING.md file in line with the one on the main Kedro repo

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Bring CONTRIBUTING.md file in line with the one on the main Kedro repo

Signed-off-by: L. R. Couto <laurarccouto@gmail.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* docs: Fix broken link to datasets docs in README.md (#304)

fix broken link to datasets docs

Signed-off-by: Jo Stichbury <jo_stichbury@mckinsey.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* ci: Add docs rtd check on `kedro-datasets` (#299)

* Try adding docs rtd check on kedro datasets

Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>

* Add Read the Docs configuration for kedro-datasets

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* fix(datasets): do not double encode the data as json when saving an A… (#301)

* fix(datasets): do not double encode the data as json when saving an APIDataSet

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

* chore(lint): make pyling happy

Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

---------

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Co-authored-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* build(datasets): release 1.5.2 (#305)

* release 1.5.2

minor release to fix the kedro-datasets optional dependencies issue

* Update RELEASE.md

* Trim whitespace

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

---------

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Add plugin contribution details to CONTRIBUTING.md

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Update CONTRIBUTING.md

Co-authored-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Apply minor changes on CONTRIBUTING.md

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Push code of conduct text block to the top on CONTRIBUTING.md

Signed-off-by: L. R. Couto <laurarccouto@gmail.com>

* Fix trailing whitespace lint error

Signed-off-by: L. R. Couto <laurarccouto@gmail.com>

---------

Signed-off-by: lrcouto <laurarccouto@gmail.com>
Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: L. R. Couto <laurarccouto@gmail.com>
Signed-off-by: Jo Stichbury <jo_stichbury@mckinsey.com>
Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Co-authored-by: Dmitry Sorokin <40151847+DimedS@users.noreply.github.com>
Co-authored-by: Nok <nok.lam.chan@quantumblack.com>
Co-authored-by: Jo Stichbury <jo_stichbury@mckinsey.com>
Co-authored-by: Merel Theisen <49397448+merelcht@users.noreply.github.com>
Co-authored-by: Florian Gaudin-Delrieu <9217921+FlorianGD@users.noreply.github.com>
Co-authored-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
PtrBld pushed a commit to PtrBld/kedro-plugins that referenced this pull request Aug 27, 2023
kedro-org#301)

* fix(datasets): do not double encode the data as json when saving an APIDataSet

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

* chore(lint): make pyling happy

Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

---------

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Co-authored-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
PtrBld pushed a commit to PtrBld/kedro-plugins that referenced this pull request Aug 27, 2023
…-org#294)

* Add CONTRIBUTING.md file to the Kedro-Plugins repository

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* fix(datasets): Correct pyproject.toml syntax for optional dependencies (kedro-org#302)

* Fix pyproject.toml syntax for optional dependencies

Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>

* refacor out the base dependencies

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* add comments

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* format pyproject.toml

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* Reorder pandas dependencies

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* reorder spark dependencies

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* remove polars-base and delta-base

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

---------

Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Co-authored-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Bring CONTRIBUTING.md file in line with the one on the main Kedro repo

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Bring CONTRIBUTING.md file in line with the one on the main Kedro repo

Signed-off-by: L. R. Couto <laurarccouto@gmail.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* docs: Fix broken link to datasets docs in README.md (kedro-org#304)

fix broken link to datasets docs

Signed-off-by: Jo Stichbury <jo_stichbury@mckinsey.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* ci: Add docs rtd check on `kedro-datasets` (kedro-org#299)

* Try adding docs rtd check on kedro datasets

Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>

* Add Read the Docs configuration for kedro-datasets

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* fix(datasets): do not double encode the data as json when saving an A… (kedro-org#301)

* fix(datasets): do not double encode the data as json when saving an APIDataSet

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

* chore(lint): make pyling happy

Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>

---------

Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Co-authored-by: Nok Lam Chan <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* build(datasets): release 1.5.2 (kedro-org#305)

* release 1.5.2

minor release to fix the kedro-datasets optional dependencies issue

* Update RELEASE.md

* Trim whitespace

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

---------

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Add plugin contribution details to CONTRIBUTING.md

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Update CONTRIBUTING.md

Co-authored-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Apply minor changes on CONTRIBUTING.md

Signed-off-by: lrcouto <laurarccouto@gmail.com>

* Push code of conduct text block to the top on CONTRIBUTING.md

Signed-off-by: L. R. Couto <laurarccouto@gmail.com>

* Fix trailing whitespace lint error

Signed-off-by: L. R. Couto <laurarccouto@gmail.com>

---------

Signed-off-by: lrcouto <laurarccouto@gmail.com>
Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: L. R. Couto <laurarccouto@gmail.com>
Signed-off-by: Jo Stichbury <jo_stichbury@mckinsey.com>
Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: Florian Gaudin-Delrieu <fgaudindelrieu@idmog.com>
Signed-off-by: Florian Gaudin-Delrieu <florian.gaudindelrieu@gmail.com>
Co-authored-by: Dmitry Sorokin <40151847+DimedS@users.noreply.github.com>
Co-authored-by: Nok <nok.lam.chan@quantumblack.com>
Co-authored-by: Jo Stichbury <jo_stichbury@mckinsey.com>
Co-authored-by: Merel Theisen <49397448+merelcht@users.noreply.github.com>
Co-authored-by: Florian Gaudin-Delrieu <9217921+FlorianGD@users.noreply.github.com>
Co-authored-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
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