Skip to content

Commit 533464e

Browse files
authored
Merge pull request #10 from danielbeach/fixtests
updates from version release and formatting
2 parents a688ae4 + 8f004bc commit 533464e

7 files changed

Lines changed: 24 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "drainage"
3-
version = "0.1.0"
3+
version = "0.1.7"
44
edition = "2021"
55

66
[lib]

examples/analyze_any_table.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ def analyze_any_table(
167167
print(" python analyze_any_table.py s3://my-bucket/my-table us-west-2")
168168
print(" # Specify table type explicitly")
169169
print(
170-
" python analyze_any_table.py s3://my-bucket/my-delta-table delta us-west-2"
170+
" python analyze_any_table.py s3://my-bucket/my-delta-table delta "
171+
"us-west-2"
171172
)
172173
print(
173-
" python analyze_any_table.py s3://my-bucket/my-iceberg-table iceberg us-west-2"
174+
" python analyze_any_table.py s3://my-bucket/my-iceberg-table "
175+
"iceberg us-west-2"
174176
)
175177
sys.exit(1)
176178

examples/analyze_iceberg_table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ def analyze_iceberg_table(s3_path: str, aws_region: str = "us-west-2"):
147147
print("Usage: python analyze_iceberg_table.py <s3_path> [aws_region]")
148148
print("\nExample:")
149149
print(
150-
" python analyze_iceberg_table.py s3://my-bucket/my-iceberg-table us-west-2"
150+
" python analyze_iceberg_table.py s3://my-bucket/my-iceberg-table "
151+
"us-west-2"
151152
)
152153
sys.exit(1)
153154

examples/monitor_multiple_tables.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def monitor_tables(tables: List[Tuple[str, str]], aws_region: str = "us-west-2")
8181
print("Table Health Overview (sorted by health score):")
8282
print(f"{'─'*80}")
8383
print(
84-
f"{'Path':<35} {'Type':<8} {'Health':<8} {'Files':<8} {'Size(GB)':<10} {'Issues'}"
84+
f"{'Path':<35} {'Type':<8} {'Health':<8} {'Files':<8} "
85+
f"{'Size(GB)':<10} {'Issues'}"
8586
)
8687
print(f"{'─'*80}")
8788

@@ -95,8 +96,9 @@ def monitor_tables(tables: List[Tuple[str, str]], aws_region: str = "us-west-2")
9596
)
9697
path_short = r["path"][-35:] if len(r["path"]) > 35 else r["path"]
9798
print(
98-
f"{path_short:<35} {r['type']:<8} {health_emoji} {r['health_score']:.1%} "
99-
f"{r['total_files']:<8} {r['total_size_gb']:<10.2f} {len(r['recommendations'])}"
99+
f"{path_short:<35} {r['type']:<8} {health_emoji} "
100+
f"{r['health_score']:.1%} {r['total_files']:<8} "
101+
f"{r['total_size_gb']:<10.2f} {len(r['recommendations'])}"
100102
)
101103
print()
102104

@@ -161,5 +163,7 @@ def monitor_tables(tables: List[Tuple[str, str]], aws_region: str = "us-west-2")
161163

162164
# Optional: Save results to a file
163165
# import json
164-
# with open(f"health_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json", "w") as f:
166+
# with open(
167+
# f"health_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json", "w"
168+
# ) as f:
165169
# json.dump(results, f, indent=2)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "drainage"
7-
version = "0.1.4"
7+
version = "0.1.7"
88
description = "High-performance data lake health analyzer for Delta Lake and Apache Iceberg"
99
readme = "README.md"
1010
requires-python = ">=3.8"

src/iceberg.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ impl IcebergAnalyzer {
365365
fn generate_recommendations(&self, metrics: &mut HealthMetrics) {
366366
// Add warnings about incomplete analysis sections
367367
let mut incomplete_sections = Vec::new();
368-
368+
369369
if metrics.schema_evolution.is_none() {
370370
incomplete_sections.push("Schema Evolution");
371371
}
@@ -378,14 +378,14 @@ impl IcebergAnalyzer {
378378
if metrics.file_compaction.is_none() {
379379
incomplete_sections.push("File Compaction");
380380
}
381-
381+
382382
if !incomplete_sections.is_empty() {
383383
metrics.recommendations.push(format!(
384384
"⚠️ Analysis incomplete: {} sections could not be analyzed due to missing/inaccessible metadata files (common in actively updated tables). Basic metrics are still accurate.",
385385
incomplete_sections.join(", ")
386386
));
387387
}
388-
388+
389389
// Check for unreferenced files
390390
if !metrics.unreferenced_files.is_empty() {
391391
metrics.recommendations.push(format!(
@@ -726,7 +726,7 @@ impl IcebergAnalyzer {
726726
Ok(c) => c,
727727
Err(_) => continue,
728728
};
729-
729+
730730
let metadata: Value = match serde_json::from_slice(&content) {
731731
Ok(m) => m,
732732
Err(_) => continue,
@@ -966,7 +966,7 @@ impl IcebergAnalyzer {
966966
Ok(c) => c,
967967
Err(_) => continue,
968968
};
969-
969+
970970
let metadata: Value = match serde_json::from_slice(&content) {
971971
Ok(m) => m,
972972
Err(_) => continue,
@@ -1133,7 +1133,7 @@ impl IcebergAnalyzer {
11331133
Ok(c) => c,
11341134
Err(_) => continue,
11351135
};
1136-
1136+
11371137
let metadata: Value = match serde_json::from_slice(&content) {
11381138
Ok(m) => m,
11391139
Err(_) => continue,
@@ -1402,7 +1402,7 @@ impl IcebergAnalyzer {
14021402
Ok(c) => c,
14031403
Err(_) => continue,
14041404
};
1405-
1405+
14061406
let metadata: Value = match serde_json::from_slice(&content) {
14071407
Ok(m) => m,
14081408
Err(_) => continue,

0 commit comments

Comments
 (0)