-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added static typing to data_utils.py (#662)
* added static typing to data_utils.py * changed re.Pattern type annotation to typing.Pattern * removed logging import * changed castings to if statement * fixed formatting with black * changed isinstance to cast * updated read_csv_df() type signature to include None's * changed isinstance to cast in read_json_df * removed is_buf_wrapped in favor of isinstance * added deleted comment * added is_buf_wrapped back * added JSONType * fixed formatting * added JSONType to read_json() * updated unicode_to_str docstring * moved JSONType to _typing.py * changed JSONType to be nonrecursive and removed cast on key * fix docstring Co-authored-by: Michael Davis <[email protected]> Co-authored-by: Taylor Turner <[email protected]>
- Loading branch information
1 parent
44a3256
commit e4e54b6
Showing
2 changed files
with
80 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
"""Contains typing aliases.""" | ||
from typing import Union | ||
from typing import Dict, List, Union | ||
|
||
import numpy as np | ||
import pandas as pd | ||
|
||
DataArray = Union[pd.DataFrame, pd.Series, np.ndarray] | ||
JSONType = Union[str, int, float, bool, None, List, Dict] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters