@@ -13,11 +13,11 @@ use icechunk::{
1313 Repository ,
1414 config:: Credentials ,
1515 format:: {
16- SnapshotId ,
16+ ManifestId , SnapshotId ,
1717 snapshot:: { ManifestFileInfo , SnapshotInfo , SnapshotProperties } ,
1818 transaction_log:: Diff ,
1919 } ,
20- inspect:: snapshot_json,
20+ inspect:: { manifest_json , snapshot_json} ,
2121 ops:: {
2222 gc:: { ExpiredRefAction , GCConfig , GCSummary , expire, garbage_collect} ,
2323 manifests:: rewrite_manifests,
@@ -1660,6 +1660,42 @@ impl PyRepository {
16601660 Ok ( res)
16611661 } )
16621662 }
1663+
1664+ #[ pyo3( signature = ( manifest_id, * , pretty = true ) ) ]
1665+ fn inspect_manifest ( & self , manifest_id : String , pretty : bool ) -> PyResult < String > {
1666+ let result = pyo3_async_runtimes:: tokio:: get_runtime ( )
1667+ . block_on ( async move {
1668+ let lock = self . 0 . read ( ) . await ;
1669+ let manifest = ManifestId :: try_from ( manifest_id. as_str ( ) )
1670+ . map_err ( |e| RepositoryErrorKind :: Other ( e. to_string ( ) ) ) ?;
1671+ let res = manifest_json ( lock. asset_manager ( ) , & manifest, pretty) . await ?;
1672+ Ok ( res)
1673+ } )
1674+ . map_err ( PyIcechunkStoreError :: RepositoryError ) ?;
1675+ Ok ( result)
1676+ }
1677+
1678+ #[ pyo3( signature = ( manifest_id, * , pretty = true ) ) ]
1679+ fn inspect_manifest_async < ' py > (
1680+ & self ,
1681+ py : Python < ' py > ,
1682+ manifest_id : String ,
1683+ pretty : bool ,
1684+ ) -> PyResult < Bound < ' py , PyAny > > {
1685+ let repository = self . 0 . clone ( ) ;
1686+ pyo3_async_runtimes:: tokio:: future_into_py ( py, async move {
1687+ let lock = repository. read ( ) . await ;
1688+ let manifest = ManifestId :: try_from ( manifest_id. as_str ( ) )
1689+ . map_err ( |e| {
1690+ RepositoryError :: from ( RepositoryErrorKind :: Other ( e. to_string ( ) ) )
1691+ } )
1692+ . map_err ( PyIcechunkStoreError :: RepositoryError ) ?;
1693+ let res = manifest_json ( lock. asset_manager ( ) , & manifest, pretty)
1694+ . await
1695+ . map_err ( PyIcechunkStoreError :: RepositoryError ) ?;
1696+ Ok ( res)
1697+ } )
1698+ }
16631699}
16641700
16651701fn map_credentials (
0 commit comments