Skip to content

Commit

Permalink
Update profile_report.py (#1515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amala02 authored Dec 7, 2023
1 parent 2bc13d9 commit 8d4d347
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/ydata_profiling/profile_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import warnings
from pathlib import Path
from typing import Any, Optional, Union
from PIL import Image
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import pkg_resources

try:
from pyspark.sql import DataFrame as sDataFrame
Expand All @@ -11,6 +16,7 @@

sDataFrame = TypeVar("sDataFrame") # type: ignore


from dataclasses import asdict, is_dataclass

import numpy as np
Expand Down Expand Up @@ -97,8 +103,11 @@ def __init__(
type_schema: optional dict containing pairs of `column name`: `type`
**kwargs: other arguments, for valid arguments, check the default configuration file.
"""
self.__validate_inputs(df, minimal, tsmode, config_file, lazy)


self.__validate_inputs(df, minimal, tsmode, config_file, lazy)


if config_file or minimal:
if not config_file:
config_file = get_config("config_minimal.yaml")
Expand Down Expand Up @@ -340,6 +349,13 @@ def to_file(self, output_file: Union[str, Path], silent: bool = True) -> None:
output_file: The name or the path of the file to generate including the extension (.html, .json).
silent: if False, opens the file in the default browser or download it in a Google Colab environment
"""
with warnings.catch_warnings():
warnings.simplefilter("ignore")
pillow_version = pkg_resources.get_distribution("Pillow").version
version_tuple = tuple(map(int, pillow_version.split('.')))
if version_tuple < (9, 5, 0):
warnings.warn("Try running command: 'pip install --upgrade Pillow' to avoid ValueError")

if not isinstance(output_file, Path):
output_file = Path(str(output_file))

Expand Down

0 comments on commit 8d4d347

Please sign in to comment.