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: creating Tasks with import statements #491

Merged
merged 3 commits into from
Aug 15, 2022

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Aug 11, 2022

Closes #490

Proposed Changes

Fixed creating Task with import statement:

task_flux = 'import "http"\n\n' \
            'from(bucket: "iot_center")\n' \
            '    |> range(start: -30d)\n' \
            '    |> filter(fn: (r) => r._measurement == "environment")\n' \
            '    |> aggregateWindow(every: 1h, fn: mean)'
task = self.tasks_api.create_task_cron("my-name", task_flux, "10 0 * * * *", self.organization.id)

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • pytest tests completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2022

Codecov Report

Merging #491 (b5b6e44) into master (aa0f9a5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #491   +/-   ##
=======================================
  Coverage   90.52%   90.52%           
=======================================
  Files          39       39           
  Lines        3355     3355           
=======================================
  Hits         3037     3037           
  Misses        318      318           
Impacted Files Coverage Δ
influxdb_client/client/tasks_api.py 92.39% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bednar bednar requested a review from rhajek August 11, 2022 05:19
@bednar bednar marked this pull request as ready for review August 11, 2022 05:19
CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks - I'll leave this up to see if the original reporter also confirms the fix.

Copy link

@anwu anwu left a comment

Choose a reason for hiding this comment

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

I think the fix is fine for most use cases. See comments.

influxdb_client/client/tasks_api.py Outdated Show resolved Hide resolved
@bednar
Copy link
Contributor Author

bednar commented Aug 15, 2022

The task option is now appended at the end of script. @rhajek, @powersj can you review the changes again?

@bednar bednar requested review from rhajek and powersj August 15, 2022 05:46
Copy link

@anwu anwu left a comment

Choose a reason for hiding this comment

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

lgtm_kid

@powersj powersj merged commit fade9e0 into master Aug 15, 2022
@powersj powersj deleted the fix_create_task_with_import branch August 15, 2022 19:24
@bednar bednar added this to the 1.32.0 milestone Aug 16, 2022
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.

Creating tasks with import statements fail
5 participants