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

[python-package] fix mypy errors about Dataset.params (#5780)

parent ac3668fa
...@@ -1728,7 +1728,7 @@ class Dataset: ...@@ -1728,7 +1728,7 @@ class Dataset:
used_indices: Optional[List[int]] used_indices: Optional[List[int]]
): ):
data_has_header = False data_has_header = False
if isinstance(data, (str, Path)): if isinstance(data, (str, Path)) and self.params is not None:
# check data has header or not # check data has header or not
data_has_header = any(self.params.get(alias, False) for alias in _ConfigAliases.get("header")) data_has_header = any(self.params.get(alias, False) for alias in _ConfigAliases.get("header"))
num_data = self.num_data() num_data = self.num_data()
......
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