Feat: callback to toggle editing

This commit is contained in:
2024-07-28 17:34:56 +02:00
parent 159b4a8275
commit 30913a2cea
3 changed files with 127 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
from .stage import AbstractStage
from pathlib import Path
import pandas as pd
class FSStage(AbstractStage):
def __init__(self, name, basepath, metadata_engine=None):
@@ -40,9 +41,16 @@ class FSStage(AbstractStage):
table_path = self.build_table_path(table, schema)
pass
def read(self, table:str, schema:str='.'):
def read(self, table:str, schema:str='.', read_options={}):
table_path = self.build_table_path(table, schema)
pass
extension = table_path.suffix
if extension == '.csv':
return pd.read_csv(table_path, **read_options)
if extension == '.xlsx':
return pd.read_excel(table_path, **read_options)
raise ValueError("Can't open the table")
def write(self, table:str, content, schema:str='.'):
table_path = self.build_table_path(table, schema)