This is Part 2 of a series. Read Part 1: Pandas vs Polars in Production - Performance Comparison for the background on the Polars migration. After migrating from Pandas to Polars, CPU performance improved dramatically—but a memory problem persisted. Despite extensive debugging, I couldn’t identify the root cause. So I made a pragmatic decision: architect around it. This is the story of splitting a monolithic Python application into a Go orchestration service with Python workers, not because I fully understood the problem, but because I needed production to be stable. ...
Pandas vs Polars in Production: Performance Comparison
When performance bottlenecks started affecting my production data pipeline, I decided to test whether Polars could deliver on its performance promises. This is what I learned from migrating a real production workload from Pandas to Polars. The Workload The application was a data aggregation service running as a Kubernetes pod with the following constraints: Resources: 2 CPUs, 3 GB RAM Execution frequency: Every 2-2.5 minutes Data volume: 5,000-7,000 rows × 100-150 columns per run Operations: Multiple database calls, API requests, DataFrame merges, arithmetic operations (additions, multiplications), and group-by aggregations Web server: FastAPI with Uvicorn handling production traffic All operations were properly vectorized-no row-by-row iteration. The pipeline combined data from various sources into a single DataFrame, transformed it, and output the results. ...
Converting Wide Excel Tables to Single-Page PDFs with LibreOffice
The Problem While working on a freelance project, I needed to generate PDF reports from Excel files. The challenge? The Excel files were wide and long. Here we see a sample Excel file around 15 columns containing employee data like ID, name, email, department, job title, hire date, salary, and more. I used LibreOffice’s CLI utility convert-to in headless mode to convert the files. The conversion worked, but the result was unusable: ...
Setting Up Telegram Bot on Apps Script
Here is technical side of what I did on development on Apps Script. main article // Main webhook handler - receives all Telegram updates function doPost(e) { try { if (!e || !e.postData) { return ContentService.createTextOutput('Invalid request').setMimeType(ContentService.MimeType.TEXT).setStatusCode(400); } const update = JSON.parse(e.postData.contents); if (update.message) { handleMessage(update.message); } // IMPORTANT: Always return OK with proper content type and mainly proper status code (200<=status<300) to prevent retries return ContentService.createTextOutput('OK').setMimeType(ContentService.MimeType.TEXT).setStatusCode(200); } catch (error) { console.error('Error in doPost:', error); // Even on error, return OK to prevent Telegram retries return ContentService.createTextOutput('OK').setMimeType(ContentService.MimeType.TEXT).setStatusCode(500); } } By the nature of apps script, doPost is used when the app received POST request. Telegram sends data via POST to webhook url. So we set up POST listener. ...
Apps Script
Beginning I mainly started freelancing from 2024. At that time I had a client who had accounting/consulting firm, they needed a telegram bot to create template word contracts. They said they had started doing it but didn’t have time to finish it themselves. I saw their code, it was on apps script. At that time I first came across with apps script. I made the telegram with aiogram/python. btw, I used encoding files with base64, docxtpl to render docx files from template. ...