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

Removing path and line number from warnings. #447

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions modin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
import warnings


def custom_formatwarning(msg, category, *args, **kwargs):
# ignore everything except the message
return "{}: {}\n".format(category.__name__, msg)


warnings.formatwarning = custom_formatwarning
# Filter numpy version warnings because they are not relevant
warnings.filterwarnings("ignore", message="numpy.dtype size changed")


def get_execution_engine():
# In the future, when there are multiple engines and different ways of
# backing the DataFrame, there will have to be some changed logic here to
Expand All @@ -24,9 +34,6 @@ def get_partition_format():
__execution_engine__ = get_execution_engine()
__partition_format__ = get_partition_format()

# Filter numpy version warnings because they are not relevant
warnings.filterwarnings("ignore", message="numpy.dtype size changed")

# We don't want these used outside of this file.
del get_execution_engine
del get_partition_format