autocommit 20-05-2024-08-17
This commit is contained in:
parent
649d56f992
commit
60b916c4d8
|
|
@ -14,8 +14,9 @@ describe('DATABASE', () => {
|
|||
})
|
||||
|
||||
it('create csv', () => {
|
||||
let res = create_csv_database('csv_db/x.csv', { "a_key": [], "a_value": [] })
|
||||
let res = create_csv_database('csv_db/x.csv', { "a_key": ['initial'], "a_value": [''] })
|
||||
print_head(res)
|
||||
delete_row_by_key(res, "initial", "a_key")
|
||||
|
||||
add_row(res, { "a_key": ["x"], "a_value": ["y"] })
|
||||
print_head(res)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export function save_db(db: CSVDatabase) {
|
|||
}
|
||||
|
||||
export function add_row(db: CSVDatabase, row: any) {
|
||||
let d = DataFrame([row])
|
||||
let d = DataFrame(row)
|
||||
db.df = db.df.vstack(d)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ export function create_inventory_dataframe(inventories: Inventory[]): CSVDatabas
|
|||
return create_csv_database(filepath, inventories)
|
||||
}
|
||||
|
||||
|
||||
function create_models() {
|
||||
const items: Item[] = [
|
||||
{ id: '1', name: 'Item 1', price: 100 },
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
a_key,a_value
|
||||
x,y
|
||||
|
|
|
|||
|
Loading…
Reference in New Issue