Skip to content

Commit

Permalink
Merge pull request #49 from nickrobinson/main
Browse files Browse the repository at this point in the history
Add QUERY_IN_PROGRESS_CODE to async polling check
  • Loading branch information
kenkoooo authored Dec 13, 2024
2 parents 4ba3202 + ce4af02 commit 294fc53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::SnowflakeSession;
use crate::{chunk::download_chunk, Error, Result, SnowflakeRow};

pub(super) const SESSION_EXPIRED: &str = "390112";
pub(super) const QUERY_IN_PROGRESS_CODE: &str = "333333";
pub(super) const QUERY_IN_PROGRESS_ASYNC_CODE: &str = "333334";
const DEFAULT_TIMEOUT_SECONDS: u64 = 300;

Expand Down Expand Up @@ -66,7 +67,10 @@ impl QueryExecutor {
let mut response: SnowflakeResponse =
serde_json::from_str(&body).map_err(|e| Error::Json(e, body))?;

if response.code.as_deref() == Some(QUERY_IN_PROGRESS_ASYNC_CODE) {
let response_code = response.code.as_deref();
if response_code == Some(QUERY_IN_PROGRESS_ASYNC_CODE)
|| response_code == Some(QUERY_IN_PROGRESS_CODE)
{
match response.data.get_result_url {
Some(result_url) => {
response =
Expand Down

0 comments on commit 294fc53

Please sign in to comment.