File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 9191 run : |
9292 python -m pip install --upgrade pip
9393 python -m pip install -r requirements/dev.txt
94+ python -m pip install rdata
9495 python -m pip install -e .[test]
9596
9697 - name : run Posit Connect
Original file line number Diff line number Diff line change @@ -121,6 +121,16 @@ def load_data(
121121 " Use `.pin_download()` to download the file."
122122 )
123123
124+ elif meta .type == "rds" :
125+ try :
126+ import rdata
127+
128+ return rdata .read_rds (f )
129+ except ModuleNotFoundError :
130+ raise ModuleNotFoundError (
131+ "Install the 'rdata' package to attempt to convert 'rds' files into Python objects."
132+ )
133+
124134 raise NotImplementedError (f"No driver for type { meta .type } " )
125135
126136
Original file line number Diff line number Diff line change @@ -153,9 +153,13 @@ def test_compat_pin_read(board):
153153 assert src_df .equals (dst_df )
154154
155155
156- def test_compat_pin_read_supported (board ):
157- with pytest .raises (NotImplementedError ):
158- board .pin_read ("df_rds" )
156+ def test_compat_pin_read_supported_rds (board ):
157+ pytest .importorskip ("rdata" )
158+ import pandas as pd
159+
160+ src_df = board .pin_read ("df_rds" )
161+
162+ assert isinstance (src_df , pd .DataFrame )
159163
160164
161165# pin_write ----
You can’t perform that action at this time.
0 commit comments