11import os
22
33import pandas as pd
4+ from pathlib import PurePath
45
56from oxen import DataFrame , RemoteRepo , Workspace
67
78
89def test_data_frame_crud (celeba_remote_repo_fully_pushed ):
910 _ , remote_repo = celeba_remote_repo_fully_pushed
1011
11- new_row = {"file" : "images/123456.png" , "hair_color" : "purple" }
12+ image = str (PurePath ("images" , "123456.png" ))
13+ new_row = {"file" : str (image ), "hair_color" : "purple" }
1214
15+ train_path = str (PurePath ("annotations" , "train.csv" ))
1316 df = DataFrame (
1417 remote_repo .identifier ,
15- "annotations/train.csv" ,
18+ train_path ,
1619 host = "localhost:3000" ,
1720 scheme = "http" ,
1821 )
@@ -41,11 +44,13 @@ def test_data_frame_crud(celeba_remote_repo_fully_pushed):
4144def test_data_frame_commit (celeba_remote_repo_fully_pushed ):
4245 _ , remote_repo = celeba_remote_repo_fully_pushed
4346
44- new_row = {"file" : "images/123456.png" , "hair_color" : "purple" }
47+ image = str (PurePath ("images" , "123456.png" ))
48+ new_row = {"file" : image , "hair_color" : "purple" }
4549
50+ train_path = str (PurePath ("annotations" , "train.csv" ))
4651 df = DataFrame (
4752 remote_repo .identifier ,
48- "annotations/train.csv" ,
53+ train_path ,
4954 host = "localhost:3000" ,
5055 scheme = "http" ,
5156 )
@@ -72,14 +77,16 @@ def test_remove_data_frame_row(
7277 workspace = Workspace (remote_repo , "main" )
7378 print ("Created workspace " , workspace )
7479
75- new_row = {"file" : "images/123456.png" , "hair_color" : "purple" }
80+ image = str (PurePath ("images" , "123456.png" ))
81+ new_row = {"file" : image , "hair_color" : "purple" }
7682
7783 assert len (workspace .status ().added_files ()) == 0
7884 workspace .add (file_path , "csvs" )
7985 workspace .commit ("add train.csv" )
8086
87+ train_path = str (PurePath ("csvs" , "train.csv" ))
8188 workspace = Workspace (remote_repo , "main" )
82- df = DataFrame (workspace , "csvs/train.csv" )
89+ df = DataFrame (workspace , train_path )
8390 _width , og_height = df .size ()
8491
8592 row_id = df .insert_row (new_row )
0 commit comments