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

Dask interface: Accept and forward the new if-exists query parameter #129

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

amotl
Copy link
Member

@amotl amotl commented Jun 23, 2024

About

The new if-exists query parameter will be forwarded to Dask's to_sql() method. By default, influxio will use fail.

Details

When targeting the SQLAlchemy database interface, the target table will be created automatically, if it does not exist. The if-exists URL query parameter can be used to configure this behavior. The default value is fail.

  • fail: Raise a ValueError.
  • replace: Drop the table before inserting new values.
  • append: Insert new values to the existing table.

Example usage

influxio copy \
    "http://example:token@localhost:8086/testdrive/demo" \
    "crate://crate@localhost:4200/testdrive?table=demo&if-exists=replace"

References

Copy link

codecov bot commented Jun 23, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.06%. Comparing base (fe3281e) to head (5967722).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
influxio/adapter.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
+ Coverage   79.62%   80.06%   +0.43%     
==========================================
  Files          12       12              
  Lines         638      642       +4     
==========================================
+ Hits          508      514       +6     
+ Misses        130      128       -2     
Flag Coverage Δ
unittests 80.06% <55.55%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amotl amotl changed the title pandas interface: Accept and forward the new if-exists query param pandas interface: Accept and forward the new if-exists query parameter Jun 23, 2024
@amotl amotl force-pushed the amo/target-if-exists branch from 734214f to ffa57d1 Compare June 23, 2024 00:05
@amotl amotl changed the title pandas interface: Accept and forward the new if-exists query parameter Dask interface: Accept and forward the new if-exists query parameter Jun 23, 2024
The new `if-exists` query parameter will be forwarded to Dask's
`to_sql()` method. By default, `influxio` will use `fail`.

When targeting the SQLAlchemy database interface, the target table will
be created automatically, if it does not exist. The `if-exists` URL
query parameter can be used to configure this behavior. The default
value is `fail`.

* fail: Raise a ValueError.
* replace: Drop the table before inserting new values.
* append: Insert new values to the existing table.
@amotl amotl force-pushed the amo/target-if-exists branch from ffa57d1 to 5967722 Compare June 23, 2024 09:12
@amotl amotl merged commit e8cec49 into main Jun 23, 2024
9 checks passed
@amotl amotl deleted the amo/target-if-exists branch June 23, 2024 11:09
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.

1 participant