Skip to content

Query timeout #127

Answered by pacman82
riziles asked this question in Q&A
Feb 9, 2025 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

The following test now passes using arrow-odbc python bindings 8.2.0.

def test_query_timeout():
    """
    """
    # Given a long running query
    long_running_query = "WAITFOR DELAY '0:0:03'; SELECT 42 as a"

    # When setting a query timeout of 1 second and fetching data, then we expect a timeout
    with raises(Error, match="Query timeout expired"):
        _arrow_reader = read_arrow_batches_from_odbc(
            query=long_running_query,
            connection_string=MSSQL,
            query_timeout_sec=1
        )

Enjoy!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@riziles
Comment options

@pacman82
Comment options

Answer selected by riziles
@riziles
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants