Skip to content
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
10 changes: 6 additions & 4 deletions pins/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,12 @@ class BoardManual(BaseBoard):
['df_csv']

>>> board.pin_read("df_csv")
y z
x
1 a 3
2 b 4
x y z
0 1 a 3
1 2 b 4




"""

Expand Down
8 changes: 4 additions & 4 deletions pins/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def board_github(
['df_arrow', 'df_csv', 'df_rds', 'df_unversioned']

>>> board.pin_read("df_csv")
y z
x
1 a 3
2 b 4
x y z
0 1 a 3
1 2 b 4


"""

Expand Down
4 changes: 2 additions & 2 deletions pins/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def load_data(
if meta.type == "csv":
import pandas as pd

return pd.read_csv(fs.open(path_to_file), index_col=0)
return pd.read_csv(fs.open(path_to_file))

elif meta.type == "joblib":
import joblib
Expand Down Expand Up @@ -90,7 +90,7 @@ def save_data(
raise NotImplementedError(
"Currently only pandas.DataFrame can be saved to a CSV."
)
obj.to_csv(fname)
obj.to_csv(fname, index=False)
elif type == "joblib":
import joblib

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ api_version: 1
created: 20200113T235859Z
description: some description
file: test_rsc_pin.csv
file_size: 23
pin_hash: 60d4c36d7138cb6c
file_size: 16
pin_hash: d6820e2d11300a70
title: some pin
type: csv
user: {}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ <h3>derek/test_rsc_pin</h3>
created: 20200113T235859Z
description: some description
file: test_rsc_pin.csv
file_size: 23
pin_hash: 60d4c36d7138cb6c
file_size: 16
pin_hash: d6820e2d11300a70
title: some pin
type: csv
user: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
,x,y
0,1,a
1,2,b
2,3,c
x,y
1,a
2,b
3,c
2 changes: 1 addition & 1 deletion pins/tests/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_compat_pin_read(board):
p_data = PATH_TO_EXAMPLE_BOARD / "df_csv" / "20220214T163720Z-9bfad" / "df_csv.csv"

src_df = board.pin_read("df_csv")
dst_df = pd.read_csv(p_data, index_col=0)
dst_df = pd.read_csv(p_data)

assert isinstance(src_df, pd.DataFrame)
assert src_df.equals(dst_df)
Expand Down
2 changes: 1 addition & 1 deletion pins/tests/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@pytest.fixture
def df_csv():
return pd.read_csv(PATH_TO_EXAMPLE_VERSION / "df_csv.csv", index_col=0)
return pd.read_csv(PATH_TO_EXAMPLE_VERSION / "df_csv.csv")


def check_dir_writable(p_dir):
Expand Down