Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
835 commits
Select commit Hold shift + click to select a range
caf75a6
Lazy load the Click CLI to reduce latency
rjurney Sep 2, 2025
fbebe49
Remove Company.posted_at but add Relationship.posted_at
rjurney Sep 2, 2025
d732bb0
Fix UDTF struct schema mismatch in entity resolution blocking
rjurney Sep 2, 2025
b02f5ed
Update abzu/cli/api/sec/annual_report.py
rjurney Sep 2, 2025
6ab7f7f
Update abzu/cli/api/sec/annual_report.py
rjurney Sep 2, 2025
bab28cd
Update abzu/cli/api/sec/annual_report.py
rjurney Sep 2, 2025
929beab
Reorder ER CLI commands to match execution order
rjurney Sep 2, 2025
d37add7
Merge pull request #123 from abzuc/rjurney/er
rjurney Sep 2, 2025
9a679d2
Merge branch 'main' of github.com:abzuc/weave into rjurney/er-edges
rjurney Sep 2, 2025
6bf4ce7
pre-commit without all-files
rjurney Sep 3, 2025
468c55c
Fix dupe block_key block_key_type field error
rjurney Sep 3, 2025
ef11b4e
Uniform descriptions of source_uuids field.
rjurney Sep 3, 2025
c270d8d
Move clients to Exponential fallback
rjurney Sep 3, 2025
591c2b4
save_jsonl now handles list of dicts or pd.DataFrames
rjurney Sep 3, 2025
e939a54
Grant the ability to run baml-cli
rjurney Sep 3, 2025
ab1d086
Fixed WikipediaTest which had broken text.
rjurney Sep 3, 2025
2aca77e
Test uuid tracking
rjurney Sep 3, 2025
1e29444
Add iteration support to entity resolution workflow
rjurney Sep 3, 2025
8385a99
Remind Claude Code not to mention itself again
rjurney Sep 3, 2025
5c2ec81
Fix ambiguous block_key reference in er_eval.py
rjurney Sep 3, 2025
58ab4b3
Fix ambiguous block_key reference in er_graph.py for iteration 2
rjurney Sep 3, 2025
7f49387
Only run printSchema() calls when log level is DEBUG
rjurney Sep 3, 2025
f1cf749
Setup MCP servers for project
rjurney Sep 3, 2025
fc99018
BAML test to see if source_uuids make it though merges
rjurney Sep 3, 2025
16e157a
Fix entity resolution to preserve single-record blocks and source_uuids
rjurney Sep 3, 2025
1e9c324
Make scripts/ exist
rjurney Sep 3, 2025
9db2fb9
Ignore scripts/ folder
rjurney Sep 3, 2025
7685307
Tell Claude to put debug scripts in scripts/ folder
rjurney Sep 3, 2025
677af70
Added pyspark-mcp server via uvx
rjurney Sep 3, 2025
e611d6a
Fixed spark-history MCP server setup
rjurney Sep 3, 2025
5f41f69
Rename er_graph.py to er_block.py and fix entity resolution blocking
rjurney Sep 3, 2025
cdd7950
New MCP setup...
rjurney Sep 4, 2025
43849ce
Tell Claude Code to use 'pqrs' to inspect Parquet files, install in R…
rjurney Sep 4, 2025
018e458
Remove dollar signs and parenthesis when building acronyms
rjurney Sep 4, 2025
62e5440
Working except for bug in missing companies.block_key_type field in c…
rjurney Sep 4, 2025
9ca8d2f
Added block_key_type to combined blocks companies
rjurney Sep 4, 2025
f9460f9
New client Gemini25FlashLite, used in extraction and multi-ER
rjurney Sep 5, 2025
a8118e7
Make baml assert for cik a check instead, add fields to the Wikipedia…
rjurney Sep 5, 2025
abaaeb2
Remove cik check from Company
rjurney Sep 5, 2025
1f7067b
Fix entity resolution field alignment issue
rjurney Sep 9, 2025
b072401
Tell /git not to pre-commit run --all-files as this checks files we a…
rjurney Sep 9, 2025
1f09a31
Switch back to Gemini Flash 2.0, Flash 2.5 Lite had high invalid sour…
rjurney Sep 9, 2025
230842c
Started out a kafka/ folder using Astronomer
rjurney Sep 9, 2025
31c8848
Removed tokens
rjurney Sep 9, 2025
6af39eb
Remove tokens, arg
rjurney Sep 9, 2025
3e045e9
Move extraction to Gemini Flash 2.0 as well
rjurney Sep 9, 2025
ae4f192
Update abzu/er/acronyms.py to handle nulls better with pandas.isna
rjurney Sep 9, 2025
8b72917
Add 'abzu process er clean' command to remove ER generated files
rjurney Sep 9, 2025
6d44e58
Updates to try to address poor Company.source_uuids retention and pas…
rjurney Sep 9, 2025
218c948
Paths for new first-pass UUID ER
rjurney Sep 9, 2025
1b63c29
Added section to use df.select("struct_col.*") instead of long lists …
rjurney Sep 10, 2025
bb65628
Updated paths for er paths
rjurney Sep 10, 2025
a735f55
Block size 150 -> 50 in UDTF.md
rjurney Sep 10, 2025
beef7dd
Fix null UUID bug in entity generation
rjurney Sep 10, 2025
680028e
Remove UUID deduplication workflow
rjurney Sep 10, 2025
bfbf948
Fix ER workflow: preserve original UUIDs for single-company blocks, a…
rjurney Sep 10, 2025
e216ef0
Update ER clean command to remove matches.json files
rjurney Sep 10, 2025
c5f386d
Update MAX_BLOCK_SIZE references in log messages for consistency
rjurney Sep 10, 2025
0e5f483
Ensure all companies have non-null IDs and UUIDs in build_graph
rjurney Sep 10, 2025
c1fa67b
Stricter instructions on never leaving 'id' column null
rjurney Sep 10, 2025
8b5c6a8
Prompt engineering to make sure all records have the 'id' and 'uuid' …
rjurney Sep 10, 2025
04bcf56
Logging the baml_py.Collector was breaking Rust for matching
rjurney Sep 10, 2025
8f6775f
Try to preserve source_ids field in multi-match + merge
rjurney Sep 10, 2025
16aa60e
More work on preserving 'id' and 'source_uuid' fields in multi-merge
rjurney Sep 10, 2025
218f717
Optimize CLI startup latency by implementing lazy loading
rjurney Sep 10, 2025
1d5ea78
Latest BAML tweaks based on founder feedback
rjurney Sep 10, 2025
ffde76e
Make markdown/ folder exist for all
rjurney Sep 10, 2025
2f9b632
Moved Markdown files into markdown/ folder and added them to git if t…
rjurney Sep 10, 2025
6deb7bc
+sparkdantic to convert BAML / Pydantic schema to Spark UDTF schema
rjurney Sep 10, 2025
ef06e6c
Reinstalled sparkdantic with pyspark extra
rjurney Sep 10, 2025
3580f39
Merge branch 'rjurney/kafka' of github.com:abzuc/weave into rjurney/e…
rjurney Sep 10, 2025
82a49ae
Restored -b --batch-size to control async / concurrency in 'abzu craw…
rjurney Sep 11, 2025
af17052
Work on commit commands
rjurney Sep 11, 2025
dffcf67
Block resizing UDTF unit test - fails atm but that's the point
rjurney Sep 11, 2025
88d843d
Move sparkdanti to my repo/PR for fixing bug
rjurney Sep 13, 2025
91a8773
Fix ER blocking schema mismatch for ticker struct fields
rjurney Sep 13, 2025
4251a0a
Remove Ticker.id as validating it often fails in matching
rjurney Sep 13, 2025
4b18df3
Add UUID mapper for entity resolution to handle UUID to integer ID co…
rjurney Sep 13, 2025
a45182b
Simplify BAML client initialization by using pre-initialized instance
rjurney Sep 13, 2025
72f8dd1
Rename uuid_mapper module to uuid for brevity
rjurney Sep 13, 2025
80936e1
Fix NoneType iteration error in UUID mapper for entity resolution
rjurney Sep 13, 2025
c72009b
Remove broken command
rjurney Sep 13, 2025
76340c2
Update er_block.py with improved error handling and field processing
rjurney Sep 13, 2025
773f77f
Moved kafka/ folder to abzu_airflow repo
rjurney Sep 13, 2025
c85894e
Fix entity resolution UUID handling and improve error messages
rjurney Sep 13, 2025
e144c90
Fix er_eval to properly track source UUIDs through multiple iterations
rjurney Sep 13, 2025
d0dd079
Add entity resolution stage command to run block, match, and eval seq…
rjurney Sep 13, 2025
3730d3a
Fix stage command parameter mismatch for matching step
rjurney Sep 13, 2025
79b323c
Fix metrics file path formatting to include iteration number
rjurney Sep 13, 2025
6ef21ce
Few-shot description for source_id tracking for multi-er
rjurney Sep 13, 2025
8b4d5d2
baml-py -> 0.207.0, poetry update
rjurney Sep 13, 2025
c02f60a
baml -> 0.207.0, black/isort abzu/baml_client on generate
rjurney Sep 13, 2025
10669f4
Fix source UUID tracking and pre-commit issues in ER pipeline
rjurney Sep 13, 2025
a8a51f4
Rolled back few-shot examples edit as it took id/source_ids tracking …
rjurney Sep 13, 2025
9793962
Delete stale BFS tests
rjurney Sep 13, 2025
dbb4901
Fix UUID accumulation and test issues
rjurney Sep 13, 2025
c856856
Add all_ids field to track company ID lineage in ER pipeline
rjurney Sep 13, 2025
e96a5c5
Restored 71% by removing all all_ids prompt attempt.
rjurney Sep 13, 2025
47c724f
poetry update
rjurney Sep 14, 2025
4d0b5cf
+pytest-xdist to run tests in parallel
rjurney Sep 14, 2025
5de2ddf
+prettier pre-commit
rjurney Sep 14, 2025
b76e86a
baml-py -> 0.207.1
rjurney Sep 14, 2025
89381e3
Now using Bloomberg standard exchange codes
rjurney Sep 14, 2025
ba2ef7c
Adopted Bloomberg exchange codes and mapped them across all the unit …
rjurney Sep 14, 2025
0f02421
Remove Bright Data
rjurney Sep 15, 2025
512a7e5
Much better MCP setup
rjurney Sep 15, 2025
f3d4177
Added command 'abzu process articles clean'
rjurney Sep 15, 2025
d89c70d
Added command 'abzu process rss clean'
rjurney Sep 15, 2025
d803f40
Better logging for messed up articles with not title or timestamp
rjurney Sep 15, 2025
4f36e35
black target py312 (dies) -> py311
rjurney Sep 15, 2025
acac2b1
New classes for few-shot prompting for multi-match+merge
rjurney Sep 15, 2025
c8230f1
Working on few-shot prompt, keep getting worse performance...
rjurney Sep 15, 2025
a9b5760
Moved 'abzu process er eval names' file path info outside of metrics …
rjurney Sep 15, 2025
726e717
Disable system role, it sucks for Google
rjurney Sep 15, 2025
541addb
Stopped extracting urls from web pages - it took up as much space as …
rjurney Sep 15, 2025
128b1bf
Make Claude not agree with everything :(
rjurney Sep 15, 2025
ae2159e
Ignore long lines, we wrap around here...
rjurney Sep 15, 2025
5d72063
Clarify who's psychology
rjurney Sep 15, 2025
631cd37
Fixed paths for 'abzu process kg refine'
rjurney Sep 15, 2025
c0b4c57
Chopped abzu.spark.refine_kg down to bare bones to start over with th…
rjurney Sep 15, 2025
a838662
Refined paths to make 'abzu process kg refine' go
rjurney Sep 15, 2025
70a6d34
Added 'abzu mypy clear' command to clear all Python / mypy caches. Of…
rjurney Sep 15, 2025
feed3db
Add few-shot entity resolution support and refine knowledge graph pro…
rjurney Sep 15, 2025
e2b61eb
Add error handling for entity resolution matching
rjurney Sep 15, 2025
2c9d072
Add config CLI command for configuration management
rjurney Sep 15, 2025
da6798f
Commented out reddit to raw KG build
rjurney Sep 15, 2025
4d95f90
Fix max_block_size parameter handling in er_block.py
rjurney Sep 25, 2025
107a6bb
Just die if '{format} appears in a path, that's and error
rjurney Sep 25, 2025
4d4a2bc
-mypy +zuban
rjurney Sep 25, 2025
92ed749
Move mysterous products.txt to data/
rjurney Sep 25, 2025
adb5b87
Remove zuban for a sec, but set it up
rjurney Sep 25, 2025
77fb864
Rename mypy command to zuban and add Playwright fetcher
rjurney Sep 25, 2025
9d08ff4
Fix all zuban type checking errors and improve type annotations
rjurney Sep 25, 2025
a482164
Fix zuban type checking errors
rjurney Sep 25, 2025
7e3eb86
bamp-py --> 0.208.4
rjurney Sep 25, 2025
7b8ddf1
BAML 0.208.4
rjurney Sep 25, 2025
66af0bc
Remove RDD usage and fix remaining type issues
rjurney Sep 28, 2025
a910ce7
Fix type annotations in test files
rjurney Sep 28, 2025
aa0474d
Fix invalid ticker exchange values in entity resolution
rjurney Sep 28, 2025
3af6f17
Fix parquet list preservation using dtype_backend='pyarrow'
rjurney Sep 28, 2025
9fdd313
Enhance ER clean command to remove all backup files
rjurney Sep 28, 2025
9661f4a
Changed output message for UUID overlap
rjurney Sep 28, 2025
6a83ca5
Use PySpark to load parquet files in ER pipeline to preserve Python l…
rjurney Sep 29, 2025
88933d5
Now have two improved few-shot examples of ID retention
rjurney Sep 29, 2025
881622f
Fix enum serialization and integer overflow in ER pipeline
rjurney Sep 30, 2025
5ac63ce
Limit backup files to only keep the most recent
rjurney Sep 30, 2025
dca8304
Improve ER match reporting and fix clean command errors
rjurney Sep 30, 2025
582bc53
Fix ER evaluation metrics to focus on actual matching results
rjurney Sep 30, 2025
486850f
Change debug log messages from 'UUIDs' to 'IDs' in BAML context
rjurney Sep 30, 2025
230461a
Updated instructions in CLAUDE.md for how to test entity resolution t…
rjurney Sep 30, 2025
a42f7b4
Claude permissions change: ask to write to the evaluation code or BAM…
rjurney Oct 1, 2025
299765b
Update from eridu CLAUDE.md
rjurney Oct 2, 2025
dc39da2
Switch ER pipeline to use JSON instead of Parquet
rjurney Nov 11, 2025
ad70b94
Merge branch 'rjurney/er-edges' of github.com:Graphlet-AI/abzu into r…
rjurney Nov 11, 2025
9c326a7
Fix source UUID validation and provenance tracking
rjurney Nov 12, 2025
bbb7cc0
Fix JSON serialization of nested Pydantic models
rjurney Nov 12, 2025
34bbe11
+wandb==0.23.0
rjurney Nov 12, 2025
ff66a24
Fix UUID provenance preservation in entity resolution
rjurney Nov 13, 2025
e67ec85
Iterations set to 3
rjurney Nov 13, 2025
164aaba
Remove integer IDs from entity resolution output between iterations
rjurney Nov 13, 2025
ea45b91
Fix edge refinement to properly map resolved company UUIDs
rjurney Nov 14, 2025
7c644b9
Fix KG refine command and path resolution
rjurney Nov 14, 2025
ee6410f
Fix Twisted reactor installation order in crawler
rjurney Nov 14, 2025
cffa3c7
baml-py -> 0.213.0
rjurney Nov 14, 2025
b88899d
BAML config 0.213.0
rjurney Nov 16, 2025
585f326
Merge branch 'rjurney/er-edges' of github.com:Graphlet-AI/abzu
rjurney Nov 17, 2025
969050e
Save the nodes too
rjurney Nov 17, 2025
d219f63
Merge branch 'main' of github.com:Graphlet-AI/abzu
rjurney Nov 17, 2025
7b1a704
Fix ER pipeline metrics and add degree-zero filtering
rjurney Nov 19, 2025
bee0eee
Update abzu/cli/process/er/all.py
rjurney Nov 19, 2025
775803d
Update abzu/spark/refine_kg.py
rjurney Nov 19, 2025
e6a58d2
Fix duplicate IDs in matching and edges
rjurney Nov 19, 2025
3a87eec
Ignore notebooks/__marimo__/
rjurney Nov 19, 2025
6feabef
Remove duplicate 'stage' command, keep 'all' command
rjurney Nov 19, 2025
86c6581
Add deduplication to refined knowledge graph
rjurney Nov 19, 2025
ce77f9c
Update er_eval with improved evaluation metrics
rjurney Nov 19, 2025
224dfb5
Add test_blocks directory to ER clean command
rjurney Nov 20, 2025
7551e89
Add graceful error handling for missing ER pipeline inputs
rjurney Nov 20, 2025
7a12572
Add reporting for block splitting in ER blocking
rjurney Nov 20, 2025
c61bca2
Add reporting for block splitting in ER blocking
rjurney Nov 22, 2025
690bdd9
baml-py 0.213.0 -> 0.214.0
rjurney Dec 6, 2025
3adcda1
Simplify final deduplication to treat UUID as another blocking key
rjurney Dec 6, 2025
bebdf26
Fix import error: use match_entities from abzu.er.match instead of no…
rjurney Dec 6, 2025
0449820
Update BAML generators configuration
rjurney Dec 6, 2025
eb7d938
Add Walmart-Amazon dataset download CLI and fix ER pipeline schema is…
rjurney Dec 6, 2025
6ec7246
Fix er_eval.py: remove non-existent match_block_key columns from select
rjurney Dec 6, 2025
4d11505
Fix schema drift: preserve null fields when writing JSON in ER pipeline
rjurney Dec 6, 2025
4142959
Make refine_kg.py resilient to missing columns in company data
rjurney Dec 6, 2025
35e379b
Remove .DS_Store
rjurney Dec 7, 2025
baf9a12
Updated deps
rjurney Dec 8, 2025
979c09e
Add JSON output for refined KG nodes and edges for jq inspection
rjurney Dec 9, 2025
9ca92de
New notebook and had to disable broken zuban
rjurney Dec 9, 2025
0b46a64
Replace product/technology UUIDs with names in relationships for visu…
rjurney Dec 9, 2025
df4b24b
Restore zuban
rjurney Dec 9, 2025
96b40cc
Fix duplicate companies by not sending source_ids to BAML
rjurney Dec 9, 2025
c1cebee
Add name blocking alongside UUID blocking in final ER step
rjurney Dec 9, 2025
6c2fdd2
Ignore .DS_Store
rjurney Dec 10, 2025
8ae4e8d
Remove zuban again, it sucks
rjurney Dec 10, 2025
2c10a7c
Remove carriage returns from company names and fix notebook graph han…
rjurney Dec 10, 2025
b91252a
Fix ER deduplication bugs and match_skip_history type mismatch
rjurney Dec 10, 2025
7e45f0b
Use 2-letter province code
rjurney Dec 12, 2025
b36c665
Fix Graphistry notebook crash and add title case normalization
rjurney Dec 12, 2025
ef52801
Fix edge deduplication to group by (src, dst, relationship)
rjurney Dec 12, 2025
72bc291
Ignore __marimo__
rjurney Dec 12, 2025
1af578c
Working notebook that visualizes network
rjurney Dec 12, 2025
7c75a91
Working notebook
rjurney Dec 12, 2025
95ffa82
Add article filtering, ER block splitting, tests, and Walmart-Amazon …
rjurney Dec 12, 2025
e1f4427
+sec-edgar-api
rjurney Dec 12, 2025
e8e7f52
Fix tqdm progress bar in article processor to show batch progress
rjurney Dec 13, 2025
2de11e6
Remove expensive clients as insurance against large bills for acciden…
rjurney Dec 13, 2025
bff57cf
Add tickers and wiki config sections to pipeline
rjurney Dec 13, 2025
492c955
New, complex BAML schema for Form-10K reports
rjurney Dec 13, 2025
19ddee4
New config.yml entries process.kg.tickers for adding tickers
rjurney Dec 13, 2025
6e52860
Removed old tickers file
rjurney Dec 13, 2025
d678c9d
Add SEC tickers CLI command with config-based defaults
rjurney Dec 13, 2025
08acfb0
Updated CLAUDE.md to always output two files: JSON and Parquet
rjurney Dec 13, 2025
c13f624
Use consecutive integer IDs for companies and tickers in BAML processing
rjurney Dec 14, 2025
b5ca4cc
Split ticker matching into chunks to reduce LLM context size
rjurney Dec 14, 2025
e6cef94
Add Wikipedia enrichment and refactor article processing
rjurney Dec 14, 2025
30b978a
Replace BAML ticker matching with embedding similarity and simplify W…
rjurney Dec 16, 2025
68add61
Re-enable zuban
rjurney Dec 18, 2025
a189e4f
Updated documentation for entity resolution.
rjurney Dec 18, 2025
fb606f4
Added notes about baseline blocking implementation
rjurney Dec 18, 2025
ceb9c0f
Simple parenthesis edit
rjurney Dec 18, 2025
cafb691
Replace zuban with mypy and change match output to JSONL
rjurney Dec 18, 2025
e63a52d
Back to Flash 2.0 Lite
rjurney Dec 18, 2025
a411569
Update BAML configs and dependencies for scaling
rjurney Dec 20, 2025
9c885b0
Deduplicate OrderedLazyGroup by moving to shared CLI utils module (#25)
Copilot Dec 20, 2025
ee136be
Initial plan
Copilot Dec 20, 2025
b28c9ea
Fix exchange codes: revert UQ to NASDAQ in test data
Copilot Dec 20, 2025
0cbc7c4
Merge pull request #26 from Graphlet-AI/copilot/sub-pr-20-again
rjurney Dec 20, 2025
6febe1d
Add Bloomberg Exchange Data Standard section
rjurney Dec 20, 2025
d217c85
Revert "Revert non-standard exchange codes in BAML test data" (#31)
rjurney Dec 21, 2025
a117488
Set pyspark>=0.3
rjurney Dec 21, 2025
bc2e22e
Merge branch 'rjurney/scale' of github.com:Graphlet-AI/abzu into rjur…
rjurney Dec 21, 2025
c86e8f2
graphistry>=0.48.0
rjurney Dec 21, 2025
3e03265
Add Schema Management section and SparkDantic fork documentation
rjurney Dec 22, 2025
7ee4486
Fixed janky paths in ER final
rjurney Dec 22, 2025
17fb629
Never replace on existing paths in Spark README
rjurney Dec 22, 2025
b3b0ebd
Add uuid_blocks_path parameter to ER final CLI and function
rjurney Dec 22, 2025
f0fa21a
Add uuid_matches_path parameter to ER final CLI and function
rjurney Dec 22, 2025
4136bbc
Added note about 'abzu process er final'
rjurney Dec 22, 2025
75a7aaf
Make same as first blocking
rjurney Dec 22, 2025
54683e6
Consolidate SplitLargeBlocks UDTF and simplify er_final.py
rjurney Dec 22, 2025
0111ea7
Add missing uuid_blocks_path and uuid_matches_path args to all.py
rjurney Dec 22, 2025
1c6c57b
Add explicit schema when reading matches.jsonl in er_eval.py
rjurney Dec 22, 2025
ed519e7
Fix normalize_company_dataframe to cast missing fields to correct BAM…
rjurney Dec 22, 2025
bb0d2e9
Add --debug flag to control BAML debug output in ER match commands
rjurney Dec 22, 2025
685d867
Do a final dedupe on records in er eval
rjurney Dec 22, 2025
01ee4b9
Less logging
rjurney Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ repos:
entry: isort
language: system
types: [python]
# - repo: local
# hooks:
# - id: zuban
# name: zuban
# entry: zuban check
# language: system
# types: [python]
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
exclude: ^tests/
# Prettier - formats Markdown (and other files)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0 # Use the latest version
Expand Down
44 changes: 39 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Do not be afraid to question what I say. Do not always respond with "You're righ
- Test specific cache modes: `poetry run pytest -e ABZU_CACHE_MODE=hybrid tests/test_sync.py`
- Lint: `pre-commit run` is better than `poetry run flake8`. Don't use `--all-files` with pre-commit.
- Format: `poetry run black abzu tests`, `poetry run isort abzu tests`
- Type check: `poetry run zuban check`
- Type check: `poetry run mypy abzu`
- Place temporary scripts for debugging in the `scripts/` directory.
- Use the `pqrs` utility to inspect Parquet files: `pqrs schema <path_to_parquet_file>`, `pqrs row-count <path_to_parquet_file>`, `pqrs head <path_to_parquet_file>`

Expand All @@ -30,6 +30,9 @@ Test one iteration of the full entity resolution pipeline each time you make cha
- Block with `abzu process er block names --iteration 1 -m 30`
- Match with `abzu process er match names --iteration 1 -b 50` - note you can use the `-n` option to limit the number of rows processed for faster testing.
- Evaluate with `abzu process er eval names --iteration 1`
- Evaluate with `abzu process er final --iteration 1`

You can do all of these steps in one command with `abzu process er all --iteration 1 -m 100 -b 40 ` to process only 1000 rows for faster testing.

### Docker Development (via Taskfile)

Expand All @@ -50,6 +53,10 @@ Test one iteration of the full entity resolution pipeline each time you make cha
- API operations: `abzu api financialdatasets`, `abzu api sec download --ticker NVDA`
- Run pipeline steps: `abzu steps`

## Bloomberg Exchange Data Standard

Download and use the [Bloomberg Exchange codes](https://www.inforeachinc.com/wp-content/uploads/exchanges.xlsx) for encoding all BAML or other `Ticker.exchange` fields. Use the two letter Bloomberg code not `NASDAQ`, etc. or if unknown use the three letter code `UNK`.

## Architecture Overview

### Project Structure
Expand Down Expand Up @@ -88,6 +95,12 @@ Test one iteration of the full entity resolution pipeline each time you make cha
4. **KG Refine**: Deduplicate and enrich → refined Parquet files
5. **APIs**: Enrich with financial/SEC data

### Semantic Matching

- **Blocking**: Semantic clustering to group similar entities. See @markdown/BLOCKING.md
- **Matching**: LLM-based pairwise entity comparison. See @abzu/er/match.py
- **Evaluation**: Precision/recall metrics against ground truth

## Code Style

- KISS: KEEP IT SIMPLE STUPID. Do not over-engineer solutions. ESPECIALLY for Spark / PySpark.
Expand All @@ -107,11 +120,11 @@ Test one iteration of the full entity resolution pipeline each time you make cha
- Tests: Use pytest for testing, include type hints in test functions, use fixtures for setup/teardown
- Tests: Don't make a class to contain unit tests. Just write the tests in pytest style.
- Type hints: Use Python 3.9 type hints for all function parameters and return types. Use `list`, `dict`, `tuple`, etc. instead of `List`, `Dict`, `Tuple` from the `typing` module. Use `Optional` from the `typing` module for optional parameters.
- Type checking: Use zuban for type checking, run zuban before committing code
- Type checking: Use mypy for type checking, run mypy before committing code
- Logging: Use logging for error handling, avoid print statements. Always use `from abzu.logs import get_logger` and `logger = get_logger(__name__)`
- Documentation: Use Sphinx for documentation, include docstrings in all public functions/classes
- Code style: Follow PEP 8 for Python code style, use flake8 for linting
- Zuban: Use zuban for type checking, it is a faster version of mypy. Run zuban via pre-commit before committing code. Configure it in `pyproject.toml` under `[tool.zuban]`.
- Mypy: Use mypy for type checking. Run mypy via pre-commit before committing code. Configure it in `pyproject.toml` under `[tool.mypy]`.
- Pre-commit: Use pre-commit for linting and formatting, configure it in `.pre-commit-config.yaml`
- Git: Use git for version control, commit often with clear messages, use branches for new features/bug fixes. Always test new features in the CLI before you commit them.
- Poetry: Use poetry for dependency management and packaging, configure it in `pyproject.toml`
Expand All @@ -123,6 +136,27 @@ Test one iteration of the full entity resolution pipeline each time you make cha
- Space Lines - never create a line with only spaces.
- Imports - don't check if things are installed and handle it with a try/except. Instead, assume they are installed and import them directly. If they are not installed, the code will fail at runtime, which is acceptable in this project.

## Schema Management

All schemas are currently defined in `baml_src/` files, which are used to generate the schemas in `abzu/baml_client/types.py`. There is code in `abzu/ dit the BAML source files in `baml_src/`and regenerate the client with`baml-cli generate`.

When defining new schemas, ensure they are compatible with PySpark and include all necessary fields for data processing.

### SparkDantic

We use our own branch of SparkDantic for schema management to convert from BAML/PyDantic schemas to PySpark. Do not use the original SparkDantic package. Always use the code in `sparkdantic @ git+https://github.com/Graphlet-AI/sparkdantic.git@ff1d38d595b2c62700ccba6c10dc613832fe368c` until we get our [SparkDantic PR](https://github.com/mitchelllisle/sparkdantic/pull/799) merged. When making changes to schemas, ensure compatibility with our SparkDantic fork.

When in doubt, specify the schema when loading data into Spark DataFrames to avoid schema inference issues.

## File Formats

Always save data in two formats:

1. Parquet - for efficient processing with Spark and Pandas without processing sub-folders manually.
2. Single file JSONL - for debugging and manual inspection.

When writing code that outputs data, ensure both formats are written unless explicitly instructed otherwise. We serialize entire records in Parquet format in ALL stages except for `abzu/er/match.py` because of a Parquet error in nested structures.

## Development Guidelines

- Command Line Interfaces - at the end of your coding tasks, please alter the 'abzu' CLI to accommodate the changes. It is a Python / Click CLI.
Expand All @@ -141,7 +175,7 @@ Test one iteration of the full entity resolution pipeline each time you make cha
- Flake8 - fix flake8 errors without being asked and without my verification.
- Black - fix black errors without being asked and without my verification.
- Isort - fix isort errors without being asked and without my verification.
- Zuban - fix zuban errors without being asked and without my verification.
- Mypy - fix mypy errors without being asked and without my verification.
- Pre-commit - fix pre-commit errors without being asked and without my verification.
- New Modules - create a folder for a new module without being asked and without my verification.
- **init**.py - add these files to new module directories without being asked and without my verification.
Expand Down Expand Up @@ -217,7 +251,7 @@ In addition, when writing PySpark code:

- Python 3.12 required
- Core packages: pyspark==3.5.5, scrapy==2.11, baml, kuzu, discord.py
- Development tools: poetry, black, isort, flake8, zuban, pytest
- Development tools: poetry, black, isort, flake8, mypy, pytest
- See pyproject.toml for complete dependency list

### Environment Variables
Expand Down
Loading