This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new 40ab60a glue: Allow `TimestampzType` (#366)
40ab60a is described below
commit 40ab60a11947858fa36ca54ace494ddad7e315c2
Author: Honah J <[email protected]>
AuthorDate: Mon Feb 5 01:42:17 2024 -0800
glue: Allow `TimestampzType` (#366)
---
pyiceberg/catalog/glue.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyiceberg/catalog/glue.py b/pyiceberg/catalog/glue.py
index 8f860fa..06484cb 100644
--- a/pyiceberg/catalog/glue.py
+++ b/pyiceberg/catalog/glue.py
@@ -85,6 +85,7 @@ from pyiceberg.types import (
StringType,
StructType,
TimestampType,
+ TimestamptzType,
TimeType,
UUIDType,
)
@@ -125,6 +126,7 @@ GLUE_PRIMITIVE_TYPES = {
StringType: "string",
UUIDType: "string",
TimestampType: "timestamp",
+ TimestamptzType: "timestamp",
FixedType: "binary",
BinaryType: "binary",
}
@@ -150,7 +152,7 @@ class _IcebergSchemaToGlueType(SchemaVisitor[str]):
if isinstance(primitive, DecimalType):
return f"decimal({primitive.precision},{primitive.scale})"
if (primitive_type := type(primitive)) not in GLUE_PRIMITIVE_TYPES:
- raise ValueError(f"Unknown primitive type: {primitive}")
+ return str(primitive_type.root)
return GLUE_PRIMITIVE_TYPES[primitive_type]