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

Make task.disable_window be default source of window int #3081

Merged
merged 3 commits into from Aug 22, 2021
Merged

Make task.disable_window be default source of window int #3081

merged 3 commits into from Aug 22, 2021

Conversation

jamescooke
Copy link
Contributor

Description

When accessing task.disable_window property, use the property directly. Do not call the deprecated task.disable_window_seconds.

Motivation and Context

Fixes #3029

Current implementation gives a deprecation warning even when accessing the correct task.disable_window property, which is confusing. Fixing this means that the deprecation warning becomes more meaningful - it will only appear when task.disable_window_seconds is incorrectly accessed.

Have you tested this? If so, how?

Have ran this change locally for me in my employers' Luigi test suite and removed 21 warnings when running a small test on a single task. However, that test suite does not use disable_window.

@jamescooke jamescooke requested review from dlstadther, Tarrasch and a team as code owners May 18, 2021 17:38
@jamescooke
Copy link
Contributor Author

Please could one of @dlstadther , @Tarrasch or another maintainer approve the workflow so that tests run?

dlstadther
dlstadther previously approved these changes Aug 19, 2021
Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

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

I agree this is what is should have been all along.


@property
def disable_window_seconds(self):
warnings.warn("Use of `disable_window_seconds` has been deprecated, use `disable_window` instead", DeprecationWarning)
return None
return self.disable_window
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this line need a test added to get Codecov to go green? Happy to add it if required.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is what Codecov is complains about. If you can fix it, it would awesome.

Copy link
Collaborator

Choose a reason for hiding this comment

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

quick skim looks like only the scheduler's disable_window param is unittested. I don't immediately see any of the Task's. Having test coverage would be great if there's valuable logic that be added to verify. I won't block approval and merge without it. Let me know what you want to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added a very basic test on disable_window_seconds which (hopefully) will give the required coverage 🤞🏻

Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

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

lgtm

@dlstadther dlstadther merged commit 62c12d1 into spotify:master Aug 22, 2021
@jamescooke jamescooke deleted the patch-1 branch April 22, 2022 16:48
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.

Throwing warning for deprecated disable_window_seconds
3 participants