In my last post, I introduced PydanTable—Pydantic-native tables, lazy transforms, and Rust-backed execution. Now, let's explore the next layer: SQL. Many data tools follow a familiar pattern for SQL sources: pulling rows into Python, transforming them, and then writing them somewhere else. While this approach works, it becomes cumbersome when dealing with large datasets or when your write target is the same database from which you read. The process of “extracting everything locally” can feel more like a burden than a benefit. PydanTable now offers an optional SQL execution path, allowing you to keep transformations within the database as long as the engine supports them. You only materialize data when you actually need it on the Python side. This shifts the paradigm from classic ETL—Extract, Transform locally, Load—to a more efficient TEL: Transform in SQL, extract locally when needed, then load. The primary advantage is operational efficiency. When your load target is on the same SQL server, you can often bypass the costly step of transferring the entire result set through the application, enabling a direct transition from transformation to loading, with the server handling the heavy lifting. This approach also indicates our future direction: a more intelligent execution strategy for PydanTable. The planner will optimize work on the read side when it is safe and efficient, selecting the best compute resources rather than defaulting to local resources or a single engine that may not be ideal for the task. On the roadmap, we have plans for a MongoDB engine to allow aggregation to remain on the server before extraction or writing back, as well as a PySpark-engine that introduces strong typing to traditional Spark-style operations. I am excited to continue advancing PydanTable beyond merely “strongly typed dataframes” toward strong typing where the data already resides. #DataEngineering #Python #OpenSource #SQL #ETL
PydanTable SQL Execution Path Boosts Operational Efficiency
More Relevant Posts
-
📰 An Implementation Guide to Building a DuckDB-Python Analytics Pipeline with SQL, DataFrames, Parquet, UDFs, and Performance Profiling <p>In this tutorial, we build a comprehensive, hands-on understanding of DuckDB-Python by working through its features directly in code on Colab. We start with the fundamentals of connection management and data generation, then move into real analytical workflows, including querying Pandas, Polars, and Arrow objects without manual loading, transforming results across multiple formats, and writing […]</p> <p>The post <a href="https://lnkd.in/d96dTpxz">An Implementation Guide to Building a DuckDB-Python Analytics Pipeline with SQL, DataFrames, Parquet, UDFs, and Performance Profiling</a> appeared first on <a href="https://lnkd.in/dAdcKkWg">MarkTechPost</a>.</p> 🔗 https://lnkd.in/d96dTpxz #أخبار_التقنية #ذكاء_اصطناعي #تكنولوجيا
To view or add a comment, sign in
-
If you’re still building SQL queries using string concatenation… you’re making your life harder than it needs to be. Not because SQL is bad - but because treating queries like strings is an engineering liability. It works in dev. It breaks in production. Developers are still duct-taping raw queries together like this: "𝗦𝗘𝗟𝗘𝗖𝗧 * 𝗙𝗥𝗢𝗠 𝘂𝘀𝗲𝗿𝘀 𝗪𝗛𝗘𝗥𝗘 𝗮𝗴𝗲 > " + 𝘀𝘁𝗿(𝘂𝘀𝗲𝗿_𝗶𝗻𝗽𝘂𝘁) If your queries depend on + 𝘀𝘁𝗿(𝘂𝘀𝗲𝗿_𝗶𝗻𝗽𝘂𝘁): you’re not just writing brittle code - you’re opening the door to bugs and injection risks. On the flip side, bringing in a massive ORM just to handle a few complex joins is severe overkill. I’ve been there: • Debugging messy query strings • Chasing silent bugs • Rewriting the same logic again and again You need a middle ground. That’s where 𝗣𝘆𝗣𝗶𝗸𝗮 comes in. 𝗣𝘆𝗣𝗶𝗸𝗮: It’s a pure SQL query builder that sits in the perfect sweet spot and gives you structure without losing control: ✅ Writes in pure Python ✅ Natively parameterizes inputs (safer, avoids injection issues) ✅ Makes queries highly composable (letting FastAPI and Pydantic handle the rest) I broke down exactly why this tool is a massive upgrade over raw strings and when you should (and shouldn't) use it. Breakdown in the carousel 👇 Curious - how are you handling dynamic SQL today? #Python #SQL #DataScience #DataEngineering #BackendEngineering #SoftwareArchitecture #TechTips
To view or add a comment, sign in
-
An Implementation Guide to Building a DuckDB-Python Analytics Pipeline with SQL, DataFrames, Parquet, UDFs, and Performance Profiling - MarkTechPost https://lnkd.in/eJuvwc_a
To view or add a comment, sign in
-
🚀 Day 56 – Data Collection in Data Science Today I focused on one of the most important steps in any Data Science project — Data Collection 📊 💡 Without quality data, even the best model won’t perform well. --- 🔹 Ways to Collect Data: ✔️ APIs Fetch structured and real-time data from servers using tools like Python requests ✔️ Web Scraping Extract data from websites using BeautifulSoup and Selenium ✔️ Databases Access stored data from SQL (MySQL, PostgreSQL) or NoSQL (MongoDB) ✔️ Open Datasets Use platforms like Kaggle for ready-made datasets ✔️ Surveys & Forms Collect custom data using tools like Google Forms ✔️ Logs & Tracking Analyze user behavior from website/app logs --- ⚖️ Key Insight: API → Clean & reliable data Scraping → Useful when API is not available --- 🔥 What I Realized: Data Collection is not just gathering data — it’s about collecting the right data for your problem --- 📈 Next Step: Moving towards Data Cleaning & Preprocessing --- #Day56 #DataScience #DataCollection #Python #MachineLearning #WebScraping #API #LearningJourney #100DaysOfCode
To view or add a comment, sign in
-
-
The last two mssql-python releases shipped big features: Bulk Copy in 1.4 for high-throughput data loading, and Apache Arrow in 1.5 for zero-copy analytics. Version 1.6 is about what happens next: you take those features into production, scale up your thread pool, and find out where the driver was quietly holding you back. https://lnkd.in/d-snaHPW
To view or add a comment, sign in
-
SQL or pandas, the tool is secondary. 💡 The logic is what matters. A classic use case: employees earning above their department average. 👉 SQL ,using a CTE: WITH avg_salary AS ( SELECT department, AVG(salary) AS dept_avg FROM employees GROUP BY department ) SELECT e.name, e.salary, a.dept_avg FROM employees e JOIN avg_salary a ON e.department = a.department WHERE e.salary > a.dept_avg; 👉 pandas, same logic: avg_salary = ( employees .groupby("department")["salary"] .mean() .reset_index(name="dept_avg") ) result = employees.merge(avg_salary, on="department") result = result[result["salary"] > result["dept_avg"]] ###Same pattern. Different syntax. 🟢 aggregate by group 🟢 join back to original dataset 🟢 filter using group-level context This is what defines data work across tools. Not memorizing syntax but recognizing reusable patterns. 😊 Master the logic. The syntax will follow. #SQL #Python #Pandas #DataEngineering #DataScience
To view or add a comment, sign in
-
Python Chaos to dbt Clarity: Why I Upgraded My Data Pipeline Architecture We’ve all been there. A "simple" Python script that starts with extracting data, and ends up being a 1,000-line monster handling cleaning, joining, testing, and documentation. It works... until it doesn't. In my latest project, "SME-Modern-Sales-DWH," I decided to move away from the Monolithic ETL approach (Level 1) to a Modern ELT framework (Level 2). The Shift: Decoupling the Logic 🏗️ Instead of forcing Python to do everything, I redistributed the workload to where it belongs: 🔹 Python (The Mover): Now only handles Extract & Load. It moves raw data from CSVs to the Bronze layer. Simple, fast, and easy to maintain. 🔹 dbt-core (The Brain): Once the data is in SQL Server, dbt takes over for the Transformations. Why this is a game-changer for SMEs: 1. Automated Testing: I implemented 47 data quality tests. If the data isn't right, the build fails. No more "guessing" if the report is accurate. 2. Modular Modeling: Using Staging, Intermediate, and Marts layers. It’s built like LEGO—modular and scalable. 3. Documentation on Autopilot: dbt docs now provide a full lineage of the data, making the system transparent for everyone. 4. Surrogate Keys & Hashing: Used MD5 hashing to merge CRM and ERP data seamlessly. The Result? A reliable "Single Source of Truth" that turns fragmented data into actionable sales insights. No more "nuclear explosions" in the codebase! 💥✅ Check out the full architecture and code on GitHub: https://lnkd.in/d-BB9b9R #DataEngineering #dbt #Python #ModernDataStack #DataAnalytics #SQL #ELT #SME
To view or add a comment, sign in
-
-
9 ways you can read in Pandas (and instantly level up your data workflow): Most people focus on models and algorithms—but the real edge often comes from how efficiently you can bring data in. Here are 9 essential formats you should be comfortable with: 🔹 CSV (.csv) The most common format—simple, fast, and everywhere. Use: pd.read_csv() 🔹 Excel (.xlsx, .xls) Widely used in business for reports and multi-sheet data. Use: pd.read_excel() 🔹 JSON (.json) Perfect for API responses and semi-structured data. Use: pd.read_json() 🔹 SQL Databases Pull data directly from databases like MySQL or PostgreSQL. Use: pd.read_sql() 🔹 Parquet (.parquet) Efficient, compressed, and built for big data workflows. Use: pd.read_parquet() 🔹 Feather (.feather) Optimized for fast read/write between Python environments. Use: pd.read_feather() 🔹 HTML Tables Extract tables directly from websites. Use: pd.read_html() 🔹 Pickle (.pkl) Quickly store and load Python objects. Use: pd.read_pickle() 🔹 Text Files (.txt) Flexible format with custom delimiters (tabs, pipes, etc.). Use: pd.read_csv(sep='\\t') Why this matters: The faster you can load data, the faster you can analyze, model, and deliver impact. Strong data professionals don’t just analyze data— they know exactly how to access it. #DataScience #Pandas #Python #DataAnalytics #MachineLearning #DataEngineering #IT #MachineLearning #Growth #SQLDATABASE #HTML #TABLE #DataPreprocessing
To view or add a comment, sign in
-
-
When I joined my current team, we ran ETL. Extract from source. Transform in Python. Load clean data to BigQuery. Six months later, we switched to ELT. Load raw data to BigQuery first. Transform Inside BigQuery using dbt. Here's exactly why - and what we got wrong the first time. ───────────────── The ETL problems we kept hitting: Python transform scripts were getting complex fast. Business logic kept changing. Every new metric required updating Python, code review, redeploy, rerun. Worse: no way to replay history with new logic. Raw data was already transformed and gone. Business rule changes meant we couldn't reprocess old data. We painted ourselves into corners every sprint. ───────────────── What switching to ELT changed: → Analysts now change transformation logic themselves - in SQL, not Python → Business rule changes? Rerun dbt on historical raw data. Done in minutes. → Python pipeline went from 800 lines to ~100. The rest is dbt models. → dbt gave us automatic documentation and lineage for free ───────────────── But - ELT is Not always right. If you handle sensitive personal data (healthcare, financial), you may Not be allowed to land raw PII in your warehouse. ETL is correct here - mask or encrypt before data touches storage. ───────────────── The honest decision rule: Can your warehouse handle transformation compute? → ELT Can you store raw data affordably? → ELT Does your team prefer SQL over Python for transforms? → ELT Is data sensitivity a hard constraint? → ETL Which does your team use - and what drove that decision? 👇 #DataEngineering #ETL #ELT #dbt #BigQuery #LearningInPublic
To view or add a comment, sign in
More from this author
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
https://www.garudax.id/posts/odos-matthews_pydantable-activity-7444541918048387072-fbpd?utm_source=share&utm_medium=member_desktop&rcm=ACoAABdOlJkBZKIQ2XZkoYMEeYH3ZzD-Oe6eZaI