Skip to content

Commit 95810c3

Browse files
Heather PatrickHeather Patrick
authored andcommitted
new content added to the file
1 parent 7f43bbd commit 95810c3

1 file changed

Lines changed: 72 additions & 2 deletions

File tree

docs/data_developer_guide.md

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Data Developer Guide
22

3-
This guide explains how to add new datasets and ETL processes to your catalog repositories.
3+
This guide explains how to create, maintain, add update datasets within a **CFA DataOps** catalog repository. A catalog is a Python package that contains one or more datasets, each with configurable TOML-based ETL workflows. This guide is intended for **dataset developers** who author ETL pipelines, add new dataset versions, and manage catalog content, schemas, and validation logic.
44

55
> **Prerequisites**: You need to have a catalog repository created and installed. See [Managing Catalogs](managing_catalogs.md) for setup instructions.
66
@@ -23,6 +23,22 @@ The ETL pipeline system is built around:
2323
- Python ETL scripts that handle extraction, transformation and loading
2424
- SQL templates for transformations (optional)
2525
- Schema validation using Pandera
26+
- Catalog repository content (datasets/, reports/, workflows/, etc.)
27+
- datacat; the runtime dataset interface used to inspect, validate, and load dataset versions
28+
29+
## Key directories for developers:
30+
31+
### `datasets/`
32+
contains TOML files defining dataset ETL pipelines, metadata, validation rules, and staging behaviours.
33+
34+
### `workflows/`
35+
contains reusable Python modules or workflow scripts supporting ETL.
36+
37+
### `reports/`
38+
Contains notebook templates or report-genrating logic tied to datasets (optional).
39+
40+
### `catalog_defaults.toml`
41+
Defines common config shared by all datasets in the catalog (e.g. blob paths, validation defaults).
2642

2743
## Update an existing dataset
2844

@@ -52,7 +68,61 @@ To add a new dataset to your catalog repository:
5268
3. Create a new ETL script in `{your_catalog}/workflows/{workflow_type}/`
5369
4. Add SQL transformation templates if using SQL for transforms (these are [Mako templates](https://www.makotemplates.org/))
5470

55-
### Configuration file
71+
## Versioning Behavior
72+
73+
Dataset versions are typially timestamped (e.g. 2025-10-31). Developers can:
74+
75+
Inspect versions
76+
77+
```python
78+
from cfa.dataops import datacat
79+
80+
datacat.my_project.my_dataset.load.get_versions()
81+
```
82+
83+
Load a version
84+
85+
```python
86+
df = datacat.my_project.mydataset.load.get_dataframe()
87+
```
88+
89+
Load with a version filter
90+
91+
```python
92+
df = datacat.my_project.my_dataset.load.get_dataframe(version=">2024.12.01,<2025.08")
93+
```
94+
95+
See which version would be chosen
96+
97+
```python
98+
v = datacat.my_project.my_dataset.load.resolve_versions(version="latest")
99+
```
100+
101+
102+
103+
## Configuration file
104+
105+
Configuration sections typyically include:
106+
107+
**[extract]**
108+
109+
How raw data is sourced. Common patterns include:
110+
- reading Parquet or CSV from blob storage
111+
- applying schema checks on raw fields
112+
- filtering out malformed input
113+
114+
**[transform]**
115+
116+
Defines transformation logic. Options include:
117+
- SQL expressions (DuckDB or Polars SQL)
118+
- Python functions
119+
- multistage ETL pipelines (split into etl/modules)
120+
121+
**[load]**
122+
123+
Defines how the transformed dataset is written inot versioned storage.
124+
Versions are timestampe-based and automatically assigned when new data is produced.
125+
56126

57127
```toml title="{your_catalog}/datasets/{dataset_name}.toml"
58128
[properties]

0 commit comments

Comments
 (0)