dlt-hub / verified-sources

Contribute to dlt verified sources 🔥
https://dlthub.com/docs/walkthroughs/add-a-verified-source
Apache License 2.0
50 stars 40 forks source link

rest_api: rest_api_source changes configuration dict #452

Closed burnash closed 1 month ago

burnash commented 1 month ago

dlt version

0.4.9

Source name

rest_api

Describe the problem

When I call rest_api_source(configuration_dict), rest_api_source updates the configuration_dict. Subsequent calls to rest_api_source produce incorrect results because of misconfiguration.###

Expected behavior

Configuration dictionary should not be modified by rest_api_source() or any other functions down the line.###

Steps to reproduce

  1. Create a configuration dict specifying incremental parameter.
  2. Call rest_api_source() with this dict.
  3. Check the dict and see the parameter disappear.

How you are using the source?

I'm considering using this source in my work, but bug is preventing this.

Operating system

macOS

Runtime environment

Local

Python version

3.11

dlt destination

No response

Additional information

The change was likely introduced in https://github.com/dlt-hub/verified-sources/pull/399/files#diff-3fe00e1ecf995707cd1f5f3ea39244fdeff33f960019805f040f44ca596256afL111-R117