File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
pyo3-object_store/src/gcp Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,11 @@ pub struct PyGoogleConfigKey(GoogleConfigKey);
214214impl < ' py > FromPyObject < ' py > for PyGoogleConfigKey {
215215 fn extract_bound ( ob : & Bound < ' py , PyAny > ) -> PyResult < Self > {
216216 let s = ob. extract :: < PyBackedStr > ( ) ?. to_lowercase ( ) ;
217+ // https://github.com/apache/arrow-rs-object-store/pull/467
218+ if s == "application_credentials" {
219+ return Ok ( Self ( GoogleConfigKey :: ApplicationCredentials ) ) ;
220+ }
221+
217222 let key = s. parse ( ) . map_err ( PyObjectStoreError :: ObjectStoreError ) ?;
218223 Ok ( Self ( key) )
219224 }
Original file line number Diff line number Diff line change 11import pytest
22
3- from obstore .exceptions import BaseError
3+ from obstore .exceptions import BaseError , GenericError
44from obstore .store import GCSStore
55
66
@@ -19,3 +19,11 @@ def test_eq():
1919 assert store == store # noqa: PLR0124
2020 assert store == store2
2121 assert store != store3
22+
23+
24+ def test_application_credentials ():
25+ # The application_credentials parameter should be correctly passed down
26+ # Finalizing the GCSBuilder should try to load and parse those credentials, which
27+ # should error here.
28+ with pytest .raises (GenericError , match = "source: OpenCredentials" ):
29+ GCSStore ("bucket" , application_credentials = "path/to/creds.json" )
You can’t perform that action at this time.
0 commit comments