Uh oh!
There was an error while loading. Please reload this page.
feat: get_obstore_store function for creating Obstore store with Open PC credentials - #69
Conversation
| "the optional dependency 'obstore'." | ||
| ) from e | ||
| def credential_provider() -> AzureSASToken: |
There was a problem hiding this comment.
To make this work with MPCPro, can you:
- Rename the inner function
credential_providertoplanetary_computer_credential_provider - Add an optional callable argument to
get_obstore_storethat returns anAzureSASToken. When it's None, use theplanetary_computer_credential_providerfunction. - Write a function in
_obstore.pythat returns callable credential providers for MPCPro instances namedplanetary_computer_pro_credential_provider.
Such that an end-user can do this:
fromplanetary_computerimportget_obstore_store, planetary_computer_pro_credential_providerfromplanetary_computer.utilsimportparse_blob_urlstac_item : pystac.Item= ... # results of querying a geocatalog account, container=parse_blob_url(stac_item.assets["asset"].href)
store=get_obstore_store(account, container, credential_provider=planetary_computer_pro_credential_provider("https://geocatalog.azure.com")Maybe the call to parse_blob_url is not necessary and get_obstore_store can just accept a string argument and parse it inside? So that callers can just pass the asset href to get_obstore_store and not have to think about parsing account names and containers.
There was a problem hiding this comment.
Thinking about this a bit more:
While we can have a credential_provider parameter that matches obstore's own API, it seems a little verbose, and I think it's exposing concepts that are unnecessary here because we know users will always be using a credential provider. It's just a question of which one: Open PC or PC Pro, and that's all we need to have in our signature here. And I think we can figure out a simpler user API here in the context of users who will definitely be using PC.
There was a problem hiding this comment.
Maybe the call to parse_blob_url is not necessary and
get_obstore_storecan just accept a string argument and parse it inside? So that callers can just pass the asset href toget_obstore_storeand not have to think about parsing account names and containers.
This is why in obstore we have both AzureStore.__init__ and AzureStore.from_url so that we can customize the signature for the two different entry points.
There was a problem hiding this comment.
- rename to
get_obstore - Rename to credential provider to default to optional argument with default of open pc provider
- One day we can swap in the mpc pro credential provider there.
There was a problem hiding this comment.
Gustavo Hidalgo (@ghidalgo3) We can't have a default argument as an instance of the credential provider because the credential provider needs to know the account_name and container_name. So for now it defaults to None and that defaults to the open PC credential provider.
Kyle Barron (kylebarron)
commented
Jun 4, 2025
@microsoft-github-policy-service agree [company="Development Seed"] |
Kyle Barron (kylebarron)
commented
Jun 4, 2025
@microsoft-github-policy-service agree company="Development Seed" |
Gustavo Hidalgo (ghidalgo3)
commented
Jun 12, 2025
Can you please remove Python 3.8 from the test matrix? |
Kyle Barron (kylebarron)
commented
Jun 12, 2025
Obstore doesn't have wheels for 3.8 so this CI is failing on version 3.8. So we should remove the CI tests for 3.8 as well. |
Kyle Barron (kylebarron)
commented
Jun 12, 2025
I removed Python 3.8 from CI Gustavo Hidalgo (@ghidalgo3) Note that the minimum Python version for install is still 3.7: |
Gustavo Hidalgo (ghidalgo3)
commented
Jun 12, 2025
Can you please also increase the minimum python version in the toml to 3.9? |
Gustavo Hidalgo (ghidalgo3)
commented
Jun 17, 2025
I have edited the settings to allow your commits to run CI/CD automatically. |
Kyle Barron (kylebarron)
commented
Jun 17, 2025
I'm not sure it worked |
Kyle Barron (kylebarron)
commented
Jun 20, 2025
Gustavo Hidalgo (@ghidalgo3) looks like CI is finally passing! |
Obstore is an alternative to fsspec that's cleaner and can be more performant.
We might also want to consider whether there's an API that would allow to construct a store with either open PC or PC pro with a single function signature?
Gustavo Hidalgo (@ghidalgo3)