Unverified Commit f175cebd authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] simplify Dataset._compare_params_for_warning() (#6120)

parent 63a882b7
...@@ -2200,8 +2200,8 @@ class Dataset: ...@@ -2200,8 +2200,8 @@ class Dataset:
@staticmethod @staticmethod
def _compare_params_for_warning( def _compare_params_for_warning(
params: Optional[Dict[str, Any]], params: Dict[str, Any],
other_params: Optional[Dict[str, Any]], other_params: Dict[str, Any],
ignore_keys: Set[str] ignore_keys: Set[str]
) -> bool: ) -> bool:
"""Compare two dictionaries with params ignoring some keys. """Compare two dictionaries with params ignoring some keys.
...@@ -2210,9 +2210,9 @@ class Dataset: ...@@ -2210,9 +2210,9 @@ class Dataset:
Parameters Parameters
---------- ----------
params : dict or None params : dict
One dictionary with parameters to compare. One dictionary with parameters to compare.
other_params : dict or None other_params : dict
Another dictionary with parameters to compare. Another dictionary with parameters to compare.
ignore_keys : set ignore_keys : set
Keys that should be ignored during comparing two dictionaries. Keys that should be ignored during comparing two dictionaries.
...@@ -2222,10 +2222,6 @@ class Dataset: ...@@ -2222,10 +2222,6 @@ class Dataset:
compare_result : bool compare_result : bool
Returns whether two dictionaries with params are equal. Returns whether two dictionaries with params are equal.
""" """
if params is None:
params = {}
if other_params is None:
other_params = {}
for k in other_params: for k in other_params:
if k not in ignore_keys: if k not in ignore_keys:
if k not in params or params[k] != other_params[k]: if k not in params or params[k] != other_params[k]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment