Zach
Zach
WWindmill
Created by Zach on 5/2/2025 in #help
Bun shell script best practices?
Good question, Hugo. In theory, yes — but it just hangs at “Collecting files” when I try to use it as a library. (Even when attempting to just write to ./shared rather than .) Works locally that way as a Bun script, but I’ve had a ton of trouble getting it to work as a library with Windmill. (That’s why my solution was as a shell script from inside Bun.)
4 replies
WWindmill
Created by Zach on 5/2/2025 in #help
Bun shell script best practices?
Bumping this for visibility. I’ve stayed with this approach but not sure if it’s a best practice or not.
4 replies
WWindmill
Created by sewoza on 5/3/2025 in #help
Taking in excel spreadsheets
Since you’re a Python user, something like the following might help you get off the ground:
import pandas as pd
import io

def main(excel: bytes, sheet_name: str = None):
"""
Read specific sheet from Excel file with options.

Args:
excel: The Excel file as bytes
sheet_name: Optional sheet name (defaults to first sheet)

Returns:
Processed Excel data
"""
excel_buffer = io.BytesIO(excel)

# Read specific sheet or first sheet
df = pd.read_excel(excel_buffer, sheet_name=sheet_name or 0)

# Example processing: get summary statistics
summary = {
"rows": len(df),
"columns": len(df.columns),
"column_names": df.columns.tolist(),
"data_preview": df.head(10).to_dict(orient='records'),
"numeric_summary": df.describe().to_dict() if df.select_dtypes(include='number').shape[1] > 0 else None
}

return summary
import pandas as pd
import io

def main(excel: bytes, sheet_name: str = None):
"""
Read specific sheet from Excel file with options.

Args:
excel: The Excel file as bytes
sheet_name: Optional sheet name (defaults to first sheet)

Returns:
Processed Excel data
"""
excel_buffer = io.BytesIO(excel)

# Read specific sheet or first sheet
df = pd.read_excel(excel_buffer, sheet_name=sheet_name or 0)

# Example processing: get summary statistics
summary = {
"rows": len(df),
"columns": len(df.columns),
"column_names": df.columns.tolist(),
"data_preview": df.head(10).to_dict(orient='records'),
"numeric_summary": df.describe().to_dict() if df.select_dtypes(include='number').shape[1] > 0 else None
}

return summary
3 replies
WWindmill
Created by Zach on 3/28/2025 in #help
Prepared Statement Error - Postgres
Good question, I do have several workers: 2 native workers, 3 report workers, 3 standard workers.
4 replies