Skip to content

Add input validation on dask.dataframe.read_sql_query()#12091

Merged
jrbourbeau merged 2 commits intodask:mainfrom
jacobtomlinson:read-sql-query-input-validation
Oct 3, 2025
Merged

Add input validation on dask.dataframe.read_sql_query()#12091
jrbourbeau merged 2 commits intodask:mainfrom
jacobtomlinson:read-sql-query-input-validation

Conversation

@jacobtomlinson
Copy link
Copy Markdown
Member

@jacobtomlinson jacobtomlinson commented Oct 3, 2025

To avoid unexpected errors when accidentally passing a string query to dask.dataframe.read_sql_query() this PR adds some input validation. To stay as flexible as possible I decided to check for "is not string", the common footgun, instead of "is SQLAlchemy Selectable", but happy to discuss this.

Closes #12028

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 3, 2025

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

      9 files  ±0        9 suites  ±0   3h 10m 43s ⏱️ +57s
 18 070 tests +1   16 853 ✅ + 1   1 217 💤 ±0  0 ❌ ±0 
161 704 runs  +9  149 586 ✅ +10  12 118 💤  - 1  0 ❌ ±0 

Results for commit f6c5ea1. ± Comparison against base commit 1a306ba.

Copy link
Copy Markdown
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @jacobtomlinson!

@jrbourbeau jrbourbeau merged commit 260605e into dask:main Oct 3, 2025
22 of 24 checks passed
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

Successfully merging this pull request may close these issues.

AttributeError: 'str' object has no attribute 'limit' when reading from Trino

2 participants