examples(dagster): add csv_to_postgres project

This commit is contained in:
Masaki Yatsu
2025-09-16 00:36:56 +09:00
parent 6da1fac457
commit 42d74ff961
12 changed files with 3767 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
# csv_to_postgres
This is a [Dagster](https://dagster.io/) project scaffolded with [`dagster project scaffold`](https://docs.dagster.io/guides/build/projects/creating-a-new-project).
## Getting started
First, install your Dagster code location as a Python package. By using the --editable flag, pip will install your Python package in ["editable mode"](https://pip.pypa.io/en/latest/topics/local-project-installs/#editable-installs) so that as you develop, local code changes will automatically apply.
```bash
pip install -e ".[dev]"
```
Then, start the Dagster UI web server:
```bash
dagster dev
```
Open http://localhost:3000 with your browser to see the project.
You can start writing assets in `csv_to_postgres/assets.py`. The assets are automatically loaded into the Dagster code location as you define them.
## Development
### Adding new Python dependencies
You can specify new Python dependencies in `setup.py`.
### Unit testing
Tests are in the `csv_to_postgres_tests` directory and you can run tests using `pytest`:
```bash
pytest csv_to_postgres_tests
```
### Schedules and sensors
If you want to enable Dagster [Schedules](https://docs.dagster.io/guides/automate/schedules/) or [Sensors](https://docs.dagster.io/guides/automate/sensors/) for your jobs, the [Dagster Daemon](https://docs.dagster.io/guides/deploy/execution/dagster-daemon) process must be running. This is done automatically when you run `dagster dev`.
Once your Dagster Daemon is running, you can start turning on schedules and sensors for your jobs.
## Deploy on Dagster+
The easiest way to deploy your Dagster project is to use Dagster+.
Check out the [Dagster+ documentation](https://docs.dagster.io/dagster-plus/) to learn more.