Skip to content
Open
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
6 changes: 3 additions & 3 deletions st_files_connection/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _read_csv(path: str | Path, **kwargs) -> pd.DataFrame:
if "connection_name" in kwargs:
kwargs.pop("connection_name")

with self.open(path, "rt") as f:
with self.open(path, "rt", encoding=kwargs.get("encoding")) as f:
return pd.read_csv(f, **kwargs)

@cache_data(ttl=ttl, show_spinner="Running `files.read(...)`.")
Expand All @@ -166,7 +166,7 @@ def _read_json(path: str | Path, **kwargs) -> Any:
if "connection_name" in kwargs:
kwargs.pop("connection_name")

with self.open(path, "rt") as f:
with self.open(path, "rt", encoding=kwargs.get("encoding")) as f:
return json.load(f, **kwargs)

@cache_data(ttl=ttl, show_spinner="Running `files.read(...)`.")
Expand All @@ -175,7 +175,7 @@ def _read_jsonl(path: str | Path, **kwargs) -> pd.DataFrame:
kwargs.pop("connection_name")

kwargs['lines'] = True
with self.open(path, "rt") as f:
with self.open(path, "rt", encoding=kwargs.get("encoding")) as f:
return pd.read_json(f, **kwargs)

# Try to infer input_format from file extension if missing
Expand Down