Skip to content

Commit

Permalink
fix: bigquery schema and date inputs (#2688)
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoCasa committed Nov 23, 2023
1 parent cfd3da4 commit f5e098d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/windmill-worker/src/bigquery_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn convert_val(arg_t: String, arg_v: Value) -> Value {

match arg_t.as_str() {
"timestamp" | "datetime" => {
v = v + ":00";
v = v.trim_end_matches("Z").to_string();
}
"date" => {
let arr = v.split("T").collect::<Vec<&str>>();
Expand All @@ -235,7 +235,7 @@ fn convert_val(arg_t: String, arg_v: Value) -> Value {
let arr = v.split("T").collect::<Vec<&str>>();
match arr.as_slice() {
[_, time] => {
v = time.to_string() + ":00";
v = time.trim_end_matches("Z").to_string();
}
_ => {}
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/DBSchemaExplorer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
argName: 'api'
},
bigquery: {
code: `import { BigQuery } from '@google-cloud/bigquery@7.2.0';
code: `import { BigQuery } from 'npm:@google-cloud/bigquery@7.2.0';
export async function main(args: bigquery) {
const bq = new BigQuery({
credentials: args
Expand All @@ -139,7 +139,7 @@ GROUP BY table_name".replace('{dataset.id}', dataset.id)
}
return schema
}`, // nested template literals
lang: 'bun',
lang: 'deno',
argName: 'args'
},
snowflake: {
Expand Down

0 comments on commit f5e098d

Please sign in to comment.