@@ -58,7 +58,7 @@ pub fn search<'py>(
5858}
5959
6060#[ pyfunction]
61- #[ pyo3( signature = ( outfile, href, * , intersects=None , ids=None , collections=None , max_items=None , limit=None , bbox=None , datetime=None , include=None , exclude=None , sortby=None , filter=None , query=None , format=None , store=None , use_duckdb=None , * * kwargs) ) ]
61+ #[ pyo3( signature = ( outfile, href, * , intersects=None , ids=None , collections=None , max_items=None , limit=None , bbox=None , datetime=None , include=None , exclude=None , sortby=None , filter=None , query=None , format=None , parquet_compression= None , store=None , use_duckdb=None , * * kwargs) ) ]
6262#[ allow( clippy:: too_many_arguments) ]
6363pub fn search_to < ' py > (
6464 py : Python < ' py > ,
@@ -77,6 +77,7 @@ pub fn search_to<'py>(
7777 filter : Option < StringOrDict > ,
7878 query : Option < Bound < ' py , PyDict > > ,
7979 format : Option < String > ,
80+ parquet_compression : Option < String > ,
8081 store : Option < AnyObjectStore > ,
8182 use_duckdb : Option < bool > ,
8283 kwargs : Option < Bound < ' _ , PyDict > > ,
@@ -95,12 +96,18 @@ pub fn search_to<'py>(
9596 query,
9697 kwargs,
9798 ) ?;
98- let format = format
99+ let mut format = format
99100 . map ( |s| s. parse ( ) )
100101 . transpose ( )
101102 . map_err ( Error :: from) ?
102103 . or_else ( || Format :: infer_from_href ( & outfile) )
103104 . unwrap_or_default ( ) ;
105+ if matches ! ( format, Format :: Geoparquet ( _) ) {
106+ if let Some ( parquet_compression) = parquet_compression {
107+ tracing:: debug!( "setting parquet compression: {parquet_compression}" ) ;
108+ format = Format :: Geoparquet ( Some ( parquet_compression. parse ( ) . map_err ( Error :: from) ?) ) ;
109+ }
110+ }
104111 if use_duckdb
105112 . unwrap_or_else ( || matches ! ( Format :: infer_from_href( & href) , Some ( Format :: Geoparquet ( _) ) ) )
106113 {
0 commit comments