Skip to content

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

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.52%. Comparing base (aa0f9a5) to head (b5b6e44).
Report is 113 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #491   +/-   ##
=======================================
  Coverage   90.52%   90.52%           
=======================================
  Files          39       39           
  Lines        3355     3355           
=======================================
  Hits         3037     3037           
  Misses        318      318           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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
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.

@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