PostHog / PostHog/posthog

Be able to run Python scripts to interrogate SQL queries

Open
#32,140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Feature request

Is your feature request related to a problem?

The level of depth in SQL developers have varies a lot, even amongst Python experts. Sometimes we don't know how to solve for something as simple as a for loop but in SQL.

Describe the solution you'd like

It would be great to be able to run Python (e.g. notebooks) on the SQL data one pulls. This would let us e.g. build a table in SQL and go deep on the question using Python.

Describe alternatives you've considered

Downloading and running locally or connecting the DB somehow to external notebook.

Additional context

Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue describes running Python notebooks against SQL query data but names no files, tests, or entry points. Start by mapping the existing SQL query and results workflow and searching for notebook or Python integration points. Done should be defined as a supported way to use query data in Python, with clear scope and acceptance criteria agreed with maintainers.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python, sql
Domain
analytics, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.