Skip to content

Commit 64fd953

Browse files
satraclaude
andcommitted
fix(040): fix ruff errors in test files — missing ParquetStore import, write_staged_batch
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c5b2a27 commit 64fd953

2 files changed

Lines changed: 26 additions & 9 deletions

File tree

library/tests/test_pipeline_e2e.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from undata_library.commit import commit_staged
1313
from undata_library.enrich import enrich_elements
1414
from undata_library.ingest import ingest_source
15-
from undata_library.staging import create_staging_dir, generate_run_id
15+
from undata_library.staging import create_staging_dir, generate_run_id, write_staged_batch
16+
from undata_library.storage.parquet_store import ParquetStore
1617
from undata_library.utils import write_yaml
1718

1819

@@ -71,12 +72,18 @@ def test_synthetic_element_committed(self, tmp_path):
7172
# Add a synthetic element to a new staging run
7273
run_id = generate_run_id()
7374
staging = create_staging_dir(tmp_path, run_id)
74-
write_yaml(
75-
staging / "elements" / "synthetic_test.yaml",
76-
{
77-
"semantic": {"data_type": "float", "unit": "meter"},
78-
"provenance": [{"source": "test", "class": "synthetic", "name": "test_distance"}],
79-
},
75+
write_staged_batch(
76+
staging,
77+
"elements",
78+
[
79+
{
80+
"semantic": {"data_type": "float", "unit": "meter"},
81+
"provenance": [
82+
{"source": "test", "class": "synthetic", "name": "test_distance"}
83+
],
84+
}
85+
],
86+
source="test",
8087
)
8188
commit_staged(staging, tmp_path)
8289

library/tests/test_staging.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ def test_count_staged(tmp_path):
4646
write_staged_batch(
4747
staging,
4848
"elements",
49-
[{"semantic": {"data_type": "string"}, "provenance": [{"source": "t", "class": "X", "name": "a"}]}],
49+
[
50+
{
51+
"semantic": {"data_type": "string"},
52+
"provenance": [{"source": "t", "class": "X", "name": "a"}],
53+
}
54+
],
5055
source="test",
5156
)
5257
assert count_staged(staging, "elements") == 1
@@ -57,7 +62,12 @@ def test_iter_staged(tmp_path):
5762
write_staged_batch(
5863
staging,
5964
"elements",
60-
[{"semantic": {"data_type": "string"}, "provenance": [{"source": "t", "class": "X", "name": "a"}]}],
65+
[
66+
{
67+
"semantic": {"data_type": "string"},
68+
"provenance": [{"source": "t", "class": "X", "name": "a"}],
69+
}
70+
],
6171
source="test",
6272
)
6373
entities = list(iter_staged(staging, "elements"))

0 commit comments

Comments
 (0)