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

Add nil check in get call for gcp_bigquery_table table. closes #324 #329

Merged
merged 3 commits into from
Nov 23, 2021

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Nov 22, 2021

Integration test logs

Logs
No env file present for the current environment:  staging 
 Falling back to .env config
No env file present for the current environment:  staging
customEnv TURBOT_TEST_EXPECTED_TIMEOUT undefined

SETUP: tests/gcp_bigquery_table []

PRETEST: tests/gcp_bigquery_table

TEST: tests/gcp_bigquery_table
Running terraform
data.google_client_config.current: Refreshing state...
data.null_data_source.resource: Refreshing state...
google_service_account.named_test_resource: Creating...
google_bigquery_dataset.named_test_resource: Creating...
google_bigquery_dataset.named_test_resource: Creation complete after 2s [id=projects/parker-aaa/datasets/turbottest31568]
google_bigquery_table.named_test_resource: Creating...
google_service_account.named_test_resource: Creation complete after 3s [id=projects/parker-aaa/serviceAccounts/[email protected]]
google_bigquery_table.named_test_resource: Creation complete after 1s [id=projects/parker-aaa/datasets/turbottest31568/tables/turbottest31568]

Warning: Deprecated Resource

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Apply complete! Resources: 3 added, 0 changed, 0 destroyed.

Outputs:

etag = R01ADcxL8dWegKe9vVLKPw==
project_id = parker-aaa
region_id = us-east1
resource_aka = gcp://bigquery.googleapis.com/projects/parker-aaa/datasets/turbottest31568/tables/turbottest31568
resource_id = projects/parker-aaa/datasets/turbottest31568/tables/turbottest31568
resource_name = turbottest31568
self_link = https://bigquery.googleapis.com/bigquery/v2/projects/parker-aaa/datasets/turbottest31568/tables/turbottest31568
service_account_email = [email protected]

Running SQL query: test-get-query.sql
[
  {
    "dataset_id": "turbottest31568",
    "id": "parker-aaa:turbottest31568.turbottest31568",
    "kind": "bigquery#table",
    "labels": {
      "name": "turbottest31568"
    },
    "location": "us-east1",
    "project": "parker-aaa",
    "range_partitioning": null,
    "self_link": "https://bigquery.googleapis.com/bigquery/v2/projects/parker-aaa/datasets/turbottest31568/tables/turbottest31568",
    "table_id": "turbottest31568",
    "time_partitioning": {
      "type": "DAY"
    },
    "title": "turbottest31568",
    "type": "TABLE"
  }
]
✔ PASSED

Running SQL query: test-invalid-name-query.sql
null
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "dataset_id": "turbottest31568",
    "table_id": "turbottest31568"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://bigquery.googleapis.com/projects/parker-aaa/datasets/turbottest31568/tables/turbottest31568"
    ],
    "tags": {
      "name": "turbottest31568"
    },
    "title": "turbottest31568"
  }
]
✔ PASSED

POSTTEST: tests/gcp_bigquery_table

TEARDOWN: tests/gcp_bigquery_table

SUMMARY:

1/1 passed.


Example query results

Results
select * from gcp_bigquery_table where dataset_id = '' and table_id = ''
+------+----------+------------+----+------+-----------+---------------+-------------+------+-----------------+------+--------------+--------------------+-----------+---------------------+--------------------+----------+--------------------------+---------------+-------
| name | table_id | dataset_id | id | type | self_link | creation_time | description | etag | expiration_time | kind | kms_key_name | last_modified_time | num_bytes | num_long_term_bytes | num_physical_bytes | num_rows | require_partition_filter | snapshot_time | view_q
+------+----------+------------+----+------+-----------+---------------+-------------+------+-----------------+------+--------------+--------------------+-----------+---------------------+--------------------+----------+--------------------------+---------------+-------
+------+----------+------------+----+------+-----------+---------------+-------------+------+-----------------+------+--------------+--------------------+-----------+---------------------+--------------------+----------+--------------------------+---------------+-------

@ParthaI ParthaI self-assigned this Nov 22, 2021
@misraved misraved changed the title Fix - gcp_bigquery_table table with nil pointer exception for invalid input closes #324 Fix gcp_bigquery_table table with nil pointer exception for invalid input closes #324 Nov 22, 2021
@bigdatasourav bigdatasourav changed the title Fix gcp_bigquery_table table with nil pointer exception for invalid input closes #324 Add nil check in get call for gcp_bigquery_table table. closes #324 Nov 23, 2021
@bigdatasourav bigdatasourav merged commit 4aa64fe into main Nov 23, 2021
@bigdatasourav bigdatasourav deleted the issue-324 branch November 23, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix - gcp_bigquery_table table with nil pointer exception for invalid input
3 participants