Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: encoding should be kept as None by default + pin pandas to v1.2.5 #122

Merged
merged 2 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
58 changes: 25 additions & 33 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ chardet = "^4.0.0"
fastparquet = "^0.8.0"
jq = "^1.2.1"
openpyxl = "^3.0.9"
pandas = "^1.2.5"
pandas = "1.2.5"
paramiko = "^2.9.2"
pydantic = "^1.9.0"
python-slugify = ">=5.0.2,<7.0.0"
Expand Down
Loading