Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Apr 8, 2022
1 parent 5d7e6c8 commit 1815d5e
Show file tree
Hide file tree
Showing 4 changed files with 495 additions and 2 deletions.
2 changes: 1 addition & 1 deletion peakina/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _get_single_df(
allowed_params = get_reader_allowed_params(filetype)

# Check encoding
encoding = kwargs.get("encoding", "utf-8")
encoding = kwargs.get("encoding")
if "encoding" in allowed_params:
if not validate_encoding(stream.name, encoding):
encoding = detect_encoding(stream.name)
Expand Down
2 changes: 1 addition & 1 deletion peakina/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def detect_sep(filepath: str, encoding: Optional[str] = None) -> str:
return csv.Sniffer().sniff(str_head(filepath, 100, encoding)).delimiter


def validate_sep(filepath: str, sep: str = ",", encoding: str = "utf-8") -> bool:
def validate_sep(filepath: str, sep: str = ",", encoding: Optional[str] = None) -> bool:
"""
Validates if the `sep` is a right separator of a CSV file
(i.e. the dataframe has more than one column).
Expand Down
Loading

0 comments on commit 1815d5e

Please sign in to comment.