Skip to content

Commit

Permalink
fix: python field tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roeap committed Nov 5, 2023
1 parent 9aa301e commit 12fa820
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/deltalake-core/src/kernel/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ impl Display for PrimitiveType {
PrimitiveType::Date => write!(f, "date"),
PrimitiveType::Timestamp => write!(f, "timestamp"),
PrimitiveType::Decimal(precision, scale) => {
write!(f, "decimal({}, {})", precision, scale)
write!(f, "decimal({},{})", precision, scale)
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion python/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ def test_delta_field():
assert field.name == name
assert field.type == (PrimitiveType(ty) if isinstance(ty, str) else ty)
assert field.nullable == nullable
assert field.metadata == (metadata or {})
if metadata:
assert json.loads(field.metadata["x"]) == {"y": 3}
else:
assert field.metadata == {}

# Field metadata doesn't roundtrip currently
# See: https://github.com/apache/arrow-rs/issues/478
Expand Down

0 comments on commit 12fa820

Please sign in to comment.