Fsspec integration fails for DuckDB

Open
#328 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend, databases

Research direction

Start by running the issue's two Python examples and comparing the working s3fs path with FsspecStore registration in DuckDB. Trace FsspecStore through register_filesystem and the read_parquet glob lookup; done means the obstore example finds the parquet files and returns the count without an IO Error.

Written by the indexing model from the issue text.

Description

This works with s3fs:

import duckdb
from s3fs import S3FileSystem

fs = S3FileSystem(anon=True)
con = duckdb.connect()
con.register_filesystem(fs)

sql = """\
    SELECT
        count(*)
    FROM read_parquet('s3://overturemaps-us-west-2/release/2025-02-19.0/theme=base/type=land/*', filename=true, hive_partitioning=1)
    """

con.sql(sql)

This doesn't work with obstore:

import duckdb

from obstore.fsspec import FsspecStore

fs = FsspecStore("s3", skip_signature=True, region="us-west-2")
con = duckdb.connect()
con.register_filesystem(fs)

sql = """\
    SELECT
        count(*)
    FROM read_parquet('s3://overturemaps-us-west-2/release/2025-02-19.0/theme=base/type=land/*', filename=true, hive_partitioning=1)
    """

con.sql(sql)

It errors with

---------------------------------------------------------------------------
IOException                               Traceback (most recent call last)
Cell In[7], [line 1](vscode-notebook-cell:?execution_count=7&line=1)
----> [1](vscode-notebook-cell:?execution_count=7&line=1) con.sql(sql)

IOException: IO Error: No files found that match the pattern "s3://overturemaps-us-west-2/release/2025-02-19.0/theme=base/type=land/*"

cc @machichima you may be curious about this because it signifies an incompatibility with fsspec that you might hit as well

Dominant language
Python
Stars
842
Forks
50
Avg merge
9h
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developmentseed/obstore

All issues in developmentseed/obstore

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.