Skip to content

Commit 863ed30

Browse files
committed
Removed unused config values.
1 parent e914329 commit 863ed30

File tree

6 files changed

+7
-30
lines changed

6 files changed

+7
-30
lines changed

bigquery_python_tutorial/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Create a BigQuery table, view a table schema, list all tables in a project."""
22
from .clients import LOGGER, gcs, gbq
33
from .tables import list_all_tables, get_table_schema, get_table
4-
from .insert import gcp_csv_to_table
4+
from .insert import gcs_csv_to_table
55
from .storage import upload_csv_data
66
from config import (
77
LOCAL_CSV_FILEPATH,
@@ -19,7 +19,7 @@ def init_script():
1919
blob = upload_csv_data(LOCAL_CSV_FILEPATH, GCP_BUCKET_NAME, REMOTE_CSV_DESTINATION)
2020

2121
# Insert CSV as new BigQuery table
22-
table = gcp_csv_to_table(
22+
table = gcs_csv_to_table(
2323
GCP_PROJECT_ID, GCP_BIGQUERY_DATASET_ID, GCP_BIGQUERY_TABLE_ID, blob.name
2424
)
2525

bigquery_python_tutorial/insert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
"""Create a table from CSV hosted on GCS."""
12
from google.cloud.bigquery import SourceFormat, LoadJobConfig
23
from google.api_core.exceptions import BadRequest
34
from google.cloud.bigquery.table import Table
45
from .clients import LOGGER, gbq
56
from config import GCP_BUCKET_NAME
67

78

8-
def gcp_csv_to_table(
9+
def gcs_csv_to_table(
910
project_id: str, dataset_id: str, table_id: str, remote_csv_path: str
1011
) -> Table:
1112
"""

bigquery_python_tutorial/storage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Upload file to Google Cloud Storage."""
12
from typing import Optional
23
from google.cloud.storage.blob import Blob
34
from .clients import LOGGER, gcs

config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""BigQuery upload Configuration."""
1+
"""BigQuery Configuration."""
22
from os import getenv, path
33
from dotenv import load_dotenv
44

@@ -11,10 +11,8 @@
1111
GCP_PROJECT_ID: str = getenv("GCP_PROJECT_ID")
1212

1313
# Google BigQuery
14-
GCP_BIGQUERY_TABLE_NAME: str = getenv("GCP_BIGQUERY_TABLE_NAME")
1514
GCP_BIGQUERY_TABLE_ID: str = getenv("GCP_BIGQUERY_TABLE_ID")
1615
GCP_BIGQUERY_DATASET_ID: str = getenv("GCP_BIGQUERY_DATASET_ID")
17-
GCP_BIGQUERY_URI: str = f"bigquery://{GCP_PROJECT_ID}/{GCP_BIGQUERY_DATASET_ID}"
1816

1917
# Google Cloud Storage
2018
GCP_BUCKET_URI: str = getenv("GCP_BUCKET_URI")

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)