rdblue commented on code in PR #5447:
URL: https://github.com/apache/iceberg/pull/5447#discussion_r944591756
##########
python/tests/catalog/test_hive.py:
##########
@@ -207,15 +250,137 @@ def test_create_table(table_schema_simple: Schema,
hive_table: HiveTable):
)
)
+ with open(metadata_location, encoding="utf-8") as f:
+ payload = json.load(f)
+
+ metadata = TableMetadata.parse_obj(payload)
+
+ assert "database/table" in metadata.location
+
+ assert metadata
+ assert metadata == TableMetadataV2(
+ # The following two ones are dynamic
+ location=metadata.location,
+ table_uuid=metadata.table_uuid,
+ last_updated_ms=12345000,
+ last_column_id=3,
+ schemas=[
+ Schema(
+ NestedField(field_id=1, name="foo", field_type=StringType(),
required=False),
+ NestedField(field_id=2, name="bar", field_type=IntegerType(),
required=True),
+ NestedField(field_id=3, name="baz", field_type=BooleanType(),
required=False),
+ schema_id=1,
+ identifier_field_ids=[2],
+ )
+ ],
+ current_schema_id=1,
+ partition_specs=[PartitionSpec(spec_id=0, fields=())],
+ default_spec_id=0,
+ last_partition_id=1000,
+ properties={"owner": "javaberg"},
+ current_snapshot_id=None,
+ snapshots=[],
+ snapshot_log=[],
+ metadata_log=[],
+ sort_orders=[SortOrder(order_id=0)],
+ default_sort_order_id=0,
+ refs={},
+ format_version=2,
+ last_sequence_number=0,
+ )
+
def test_load_table(hive_table: HiveTable):
catalog = HiveCatalog(HIVE_CATALOG_NAME, {}, uri=HIVE_METASTORE_FAKE_URL)
catalog._client = MagicMock()
catalog._client.__enter__().get_table.return_value = hive_table
- catalog.load_table(("default", "table"))
-
- catalog._client.__enter__().get_table.assert_called_with(dbname="default",
tbl_name="table")
+ table = catalog.load_table(("default", "new_tabl2e"))
+
+ catalog._client.__enter__().get_table.assert_called_with(dbname="default",
tbl_name="new_tabl2e")
Review Comment:
Did you intend to have `2` in the table name?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]