Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

duckdb sniff_csv fails with > 10240 lines

Open
#113 6 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
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
database

Research direction

Start with the provided Python execute call using read_csv, header=True, delim=';', and sample_size values of 10240 and 10241. Investigate why sniff_csv fails when sampling beyond 10240 lines; done means the reproduction no longer raises an "unable to detect csv format" error for larger sample sizes.

Written by the indexing model from the issue text.

Description

needs triage
What happens?

When I use sniff_csv implicitly using read_csv with the arguments ", header=True, delim=';', sample_size=10241", it triggers an "unable to detect csv format"-error.

  • I can place multiple different lines on line 20241 and they all trigger it. The lines seem fine and not different than any others.
  • When I reduce the sample_size to 10240, the import works again.
  • When I then remove lines 10236-10240 from the original file and keep the sample_size on 10240, it also works.

This indicates to me that 10240 is an upper limit for the sampling before it goes wrong, but the default is of 20xxx.

I unfortunately can't provide you the sample.

The duckdb-version is "v1.2.0"

To Reproduce
self._db.execute(f"CREATE OR REPLACE TABLE {all_table_name} AS SELECT * FROM read_csv('{self.event.tmp_file_path}', header=True, delim=';', sample_size=10241)")
OS:

Linux

DuckDB Package Version:

1.2.0

Python Version:

3.13.7

Full Name:

Michel

Affiliation:

Acme

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

No - I cannot share the data sets because they are confidential

Did you include all code required to reproduce the issue?
  • Yes, I have
Did you include all relevant configuration to reproduce the issue?
  • Yes, I have
Dominant language
Python
Stars
189
Forks
117
Avg merge
1d 58m
Merged PRs (30d)
15

Getting set up

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 duckdb/duckdb-python

All issues in duckdb/duckdb-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.