Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Google BigQuery Node): Return numeric values as integers #10943

Merged

Conversation

riascho
Copy link
Contributor

@riascho riascho commented Sep 24, 2024

Summary

Google BigQuery returns a JSON response where numeric values are always strings. This PR adds the option to Return Integers as Numbers.

image

Test Setup

  1. Create BigQuery Dummy Data
CREATE TABLE [INSERTDATASETNAME].dummy_data (
  string_column STRING,
  integer_column INT64,
  numeric_column NUMERIC(10, 2), -- Precision of 10 digits, 2 decimal places
  float_column FLOAT64,
  bignumeric_column BIGNUMERIC(20, 5), -- Precision of 20 digits, 5 decimal places
  date_column DATE
);

INSERT INTO [INSERTDATASETNAME].dummy_data (string_column, integer_column, numeric_column, float_column, bignumeric_column, date_column)
VALUES
  ('String 1', 10, 123.45, 3.14159, 1234567890.12345, '2023-01-01'),
  ('String 2', 20, 456.78, 2.71828, 9876543210.98765, '2023-02-02'),
  ('String 3', 30, 789.01, 1.61803, 1234567890.12345, '2023-03-03'),
  ('String 4', 40, 123.45, 3.14159, 9876543210.98765, '2023-04-04'),
  ('String 5', 50, 456.78, 2.71828, 1234567890.12345, '2023-05-05'),
  ('String 6', 60, 789.01, 1.61803, 9876543210.98765, '2023-06-06'),
  ('String 7', 70, 123.45, 3.14159, 1234567890.12345, '2023-07-07'),
  ('String 8', 80, 456.78, 2.71828, 9876543210.98765, '2023-08-08'),
  ('String 9', 90, 789.01, 1.61803, 1234567890.12345, '2023-09-09'),
  ('String 10', 100, 123.45, 3.14159, 9876543210.98765, '2023-10-10');
  1. Set up BigQuery Node - Execute Query with your credentials
  2. Run query select * from [INSERTDATASETNAME].dummy_data;

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team node/improvement New feature or request labels Sep 24, 2024
Copy link
Contributor

@ShireenMissi ShireenMissi left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@ShireenMissi ShireenMissi added the tests-needed This PR needs additional tests label Sep 25, 2024
Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Sep 25, 2024

n8n    Run #7046

Run Properties:  status check passed Passed #7046  •  git commit 88139389ed: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 riascho 🗃️ e2e/*
Project n8n
Branch Review node-1615-google-bigquery-node-return-integer-values
Run status status check passed Passed #7046
Run duration 04m 23s
Commit git commit 88139389ed: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 riascho 🗃️ e2e/*
Committer Ria
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 432
View all changes introduced in this branch ↗︎

adds schema check and type conversion on query response
@ShireenMissi ShireenMissi force-pushed the node-1615-google-bigquery-node-return-integer-values branch from fca9d1c to 8813938 Compare September 25, 2024 14:56
Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link
Contributor

✅ All Cypress E2E specs passed

@ShireenMissi ShireenMissi merged commit d7c1d24 into master Sep 25, 2024
43 of 59 checks passed
@ShireenMissi ShireenMissi deleted the node-1615-google-bigquery-node-return-integer-values branch September 25, 2024 15:46
This was referenced Oct 2, 2024
@janober
Copy link
Member

janober commented Oct 2, 2024

Got released with n8n@1.62.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request Released tests-needed This PR needs additional tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants