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

FEAT-#6574: UserWarning no longer displayed when Series/DataFrames are small #7323

Merged
merged 3 commits into from
Jun 19, 2024
Merged

Conversation

Jayson729
Copy link
Contributor

@Jayson729 Jayson729 commented Jun 19, 2024

What do these changes do?

When creating a DataFrame or Series, no longer display UserWarning: Distributing <class 'NoneType'> object. This may take some time. when the size of the DataFrame or Series is small.

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves UserWarning: Distributing <class 'NoneType'> object. This may take some time. #6574
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

…isplayed when Series and DataFrames are created under a certain size

Signed-off-by: Jayson Willey <91502167+Jayson729@users.noreply.github.com>
@Jayson729 Jayson729 changed the title FEAT-modin-project#6574: UserWarning: Distributing object no longer displayed when Series and DataFrames are created under a certain size FEAT-modin-project#6574: UserWarning no longer displayed when Series/DataFrames are small Jun 19, 2024
@Jayson729 Jayson729 changed the title FEAT-modin-project#6574: UserWarning no longer displayed when Series/DataFrames are small FEAT-#6574: UserWarning no longer displayed when Series/DataFrames are small Jun 19, 2024
@Jayson729
Copy link
Contributor Author

Jayson729 commented Jun 19, 2024

Apparently this fails this test https://github.com/modin-project/modin/blob/main/modin/tests/pandas/test_series.py#L3430-L3439 because there is no longer a UserWarning being given in this case. I think changing this test to the following would solve this and still test the same thing, although we will have to import warnings since that is not included in this file. Does this seem right?

Relevant pull request

def test_6782():
    datetime_scalar = datetime.datetime(1970, 1, 1, 0, 0)
    match = "Adding/subtracting object-dtype array to DatetimeArray not vectorized"
    with warnings.catch_warnings():
        warnings.filterwarnings("error", match, UserWarning)
        pd.Series([datetime.datetime(2000, 1, 1)]) - datetime_scalar

@anmyachev
Copy link
Collaborator

Does this seem right?

@Jayson729 yes, it looks great! Only the category should be different (PerformanceWarning):
https://github.com/pandas-dev/pandas/blob/c46fb76afaf98153b9eef97fc9bbe9077229e7cd/pandas/core/arrays/datetimelike.py#L1316

Note: It looks like 6782 test no longer worked as originally planned since pandas changed the warning category.

Signed-off-by: Jayson Willey <91502167+Jayson729@users.noreply.github.com>
Signed-off-by: Jayson Willey <91502167+Jayson729@users.noreply.github.com>
Copy link
Collaborator

@anmyachev anmyachev left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @Jayson729!

@anmyachev anmyachev merged commit e9ab99a into modin-project:main Jun 19, 2024
38 checks passed
arunjose696 pushed a commit to arunjose696/modin that referenced this pull request Jul 11, 2024
…DataFrames are small (modin-project#7323)

Signed-off-by: Jayson Willey <91502167+Jayson729@users.noreply.github.com>
arunjose696 pushed a commit to arunjose696/modin that referenced this pull request Jul 11, 2024
…DataFrames are small (modin-project#7323)

Signed-off-by: Jayson Willey <91502167+Jayson729@users.noreply.github.com>
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.

UserWarning: Distributing <class 'NoneType'> object. This may take some time.
2 participants