diff --git a/pieces/GetGoogleSheetPiece/models.py b/pieces/GetGoogleSheetPiece/models.py index 3f43343..5599b9a 100644 --- a/pieces/GetGoogleSheetPiece/models.py +++ b/pieces/GetGoogleSheetPiece/models.py @@ -13,12 +13,13 @@ class InputModel(BaseModel): class OutputModel(BaseModel): - output_data: dict = Field( - description="Sleep piece executed" + output_data: list = Field( + title="Output Data.", + description="List of records from the Google Sheet." ) class SecretsModel(BaseModel): service_account_data: str = Field( title="Service Account", - description="Service account JSON data for Google Sheets API", + description="Service account JSON data for Google Sheets API. Paste it as a string.", ) diff --git a/pieces/GetGoogleSheetPiece/piece.py b/pieces/GetGoogleSheetPiece/piece.py index 61ab56c..f5e8175 100644 --- a/pieces/GetGoogleSheetPiece/piece.py +++ b/pieces/GetGoogleSheetPiece/piece.py @@ -25,5 +25,8 @@ def piece_function(self, input_data: InputModel, secrets_data: SecretsModel): records = worksheet.get_all_records() df = pd.DataFrame.from_records(records) - return OutputModel(output_data=df.to_json()) + print('DF', df.to_dict()) + print('df', df.to_dict(orient='records')) + + return OutputModel(output_data=df.to_dict(orient='records'))