Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage example with HTTPStore #106

Open
diogobaeder opened this issue Dec 10, 2024 · 1 comment
Open

Add usage example with HTTPStore #106

diogobaeder opened this issue Dec 10, 2024 · 1 comment
Milestone

Comments

@diogobaeder
Copy link

Hi!

There seems to be a bug in the HTTPStore, under version 0.2.0.

If I try to load this URL: https://storage.googleapis.com/deepopinion-public/foo/bar/ubuntu-pod.json - I get this exception:

FileNotFoundError: Object at location deepopinion-public/foo/bar/ubuntu-pod.json not found: Client error with status 404 Not Found

However, a simple request to that URL shows that it works fine and returns a JSON file.

Or is it the case that I'm using the HTTPStore incorrectly? I'm using from_url to load the file.

Thanks!

@kylebarron
Copy link
Member

kylebarron commented Dec 10, 2024

Or is it the case that I'm using the HTTPStore incorrectly?

Well you didn't give an example of how you're using it, so I can't say 🙂.

You should think of HTTPStore in the same way as a bucket, with a prefix that's shared among all requests. This works:

In [1]: from obstore.store import HTTPStore

In [2]: import obstore as obs

In [3]: store = HTTPStore.from_url("https://storage.googleapis.com/deepopinion-public")

In [5]: obs.head(store, "foo/bar/ubuntu-pod.json")
Out[5]:
{'path': 'foo/bar/ubuntu-pod.json',
 'last_modified': datetime.datetime(2024, 12, 10, 21, 31, 24, tzinfo=datetime.timezone.utc),
 'size': 309,
 'e_tag': '"a91d16922283ff6e889546f531d04645"',
 'version': None}

@kylebarron kylebarron changed the title Bug in HTTPStore Add usage example with HTTPStore Dec 11, 2024
@kylebarron kylebarron added this to the 0.3.0 milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants