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 task policy example #25874

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/cluster_policies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class TimedOperator(BaseOperator, ABC):
def task_policy(task: TimedOperator):
if task.task_type == 'HivePartitionSensor':
task.queue = "sensor_queue"
if task.timeout > timedelta(hours=48):
Copy link
Contributor

Choose a reason for hiding this comment

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

This is relative to the TimedOperator just above this policy though. The [START example_task_cluster_policy] marker was moved above the TimedOperator declaration in #23468 so it will show up in the Cluster Policy doc when published. Should the TimedOperator piece be removed altogether then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems complex to change the whole example. everything I touch produce another error.
I'll leave it to someone more experienced with cluster policy.

task.timeout = timedelta(hours=48)
if task.execution_timeout > timedelta(hours=48):
task.execution_timeout = timedelta(hours=48)


# [END example_task_cluster_policy]
Expand Down