fix: bigquery schema and date inputs (#2688)

This commit is contained in:
HugoCasa
2023-11-23 14:59:33 +01:00
committed by GitHub
parent 161c3cc4bb
commit 797d7590a5
2 changed files with 4 additions and 4 deletions

View File

@@ -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>>();
@@ -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();
}
_ => {}
}

View File

@@ -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
@@ -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: {