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

Fixes #3148: Python 3.10 Deprecation Warnings #3150

Merged
merged 2 commits into from
Mar 10, 2022

Conversation

alecgarza96
Copy link
Contributor

Description

In worker.py, changed the scientific notation 1e10 literal to its equivalent 10000000000 integer literal.
In target.py, removed os.getpid() and time.time() method calls as parameters to random.seed(). Instead, refactored them to be independent variables (processID and currentTime) and passed into random.seed()

Motivation and Context

This change fixes the following warnings that were being received:

luigi/target.py:287: DeprecationWarning: non-integer arguments to randrange() have been deprecated since Python 3.10 and will be removed in a subsequent version

luigi/worker.py:161: DeprecationWarning: Seeding based on hashing is deprecated since Python 3.9 and will be removed in a subsequent version.

Have you tested this? If so, how?

Yes, as these were native python function calls their functionality was tested locally through unit tests

@alecgarza96
Copy link
Contributor Author

This PR fixes #3148

@alecgarza96 alecgarza96 changed the title Remedy DepracationWarnings when using Python 3.10 Fixes Issue #3148 Mar 8, 2022
@alecgarza96 alecgarza96 changed the title Fixes Issue #3148 Fixes #3148: Python 3.10 Deprecation Warnings Mar 8, 2022
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 300b1ad into spotify:master Mar 10, 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.

2 participants