Skip to content

Commit 0780df8

Browse files
authored
Fix: Renamed dataset from sunroof to sunroof_solar (#226)
* renamed sunroof dataset to sunroof_solar * fix: make conventional commits pass
1 parent a3f4b34 commit 0780df8

14 files changed

+64
-63
lines changed

datasets/sunroof/_terraform/sunroof_dataset.tf

-26
This file was deleted.

datasets/sunroof/_terraform/solar_potential_by_census_tract_pipeline.tf renamed to datasets/sunroof_solar/_terraform/solar_potential_by_censustract_pipeline.tf

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
*/
1616

1717

18-
resource "google_bigquery_table" "solar_potential_by_census_tract" {
18+
resource "google_bigquery_table" "sunroof_solar_solar_potential_by_censustract" {
1919
project = var.project_id
20-
dataset_id = "sunroof"
21-
table_id = "solar_potential_by_census_tract"
20+
dataset_id = "sunroof_solar"
21+
table_id = "solar_potential_by_censustract"
2222

2323
description = "Sunroof Solar Potential By Census Tract"
2424

2525

2626

2727

2828
depends_on = [
29-
google_bigquery_dataset.sunroof
29+
google_bigquery_dataset.sunroof_solar
3030
]
3131
}
3232

33-
output "bigquery_table-solar_potential_by_census_tract-table_id" {
34-
value = google_bigquery_table.solar_potential_by_census_tract.table_id
33+
output "bigquery_table-sunroof_solar_solar_potential_by_censustract-table_id" {
34+
value = google_bigquery_table.sunroof_solar_solar_potential_by_censustract.table_id
3535
}
3636

37-
output "bigquery_table-solar_potential_by_census_tract-id" {
38-
value = google_bigquery_table.solar_potential_by_census_tract.id
37+
output "bigquery_table-sunroof_solar_solar_potential_by_censustract-id" {
38+
value = google_bigquery_table.sunroof_solar_solar_potential_by_censustract.id
3939
}

datasets/sunroof/_terraform/solar_potential_by_postal_code_pipeline.tf renamed to datasets/sunroof_solar/_terraform/solar_potential_by_postal_code_pipeline.tf

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616

1717

18-
resource "google_bigquery_table" "solar_potential_by_postal_code" {
18+
resource "google_bigquery_table" "sunroof_solar_solar_potential_by_postal_code" {
1919
project = var.project_id
20-
dataset_id = "sunroof"
20+
dataset_id = "sunroof_solar"
2121
table_id = "solar_potential_by_postal_code"
2222

2323
description = "Sunroof Solar Potential By Postal Code"
@@ -26,14 +26,14 @@ resource "google_bigquery_table" "solar_potential_by_postal_code" {
2626

2727

2828
depends_on = [
29-
google_bigquery_dataset.sunroof
29+
google_bigquery_dataset.sunroof_solar
3030
]
3131
}
3232

33-
output "bigquery_table-solar_potential_by_postal_code-table_id" {
34-
value = google_bigquery_table.solar_potential_by_postal_code.table_id
33+
output "bigquery_table-sunroof_solar_solar_potential_by_postal_code-table_id" {
34+
value = google_bigquery_table.sunroof_solar_solar_potential_by_postal_code.table_id
3535
}
3636

37-
output "bigquery_table-solar_potential_by_postal_code-id" {
38-
value = google_bigquery_table.solar_potential_by_postal_code.id
37+
output "bigquery_table-sunroof_solar_solar_potential_by_postal_code-id" {
38+
value = google_bigquery_table.sunroof_solar_solar_potential_by_postal_code.id
3939
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
resource "google_bigquery_dataset" "sunroof_solar" {
19+
dataset_id = "sunroof_solar"
20+
project = var.project_id
21+
description = "Project Sunroof computes how much sunlight hits your roof in a year. Solar viability is determined using a methodology found here: https://www.google.com/get/sunroof/data-explorer/data-explorer-methodology.pdf The use of this data is subject to Google\u0027s Terms of Service. Feel free to include this data from Project Sunroof in other analyses, materials, reports, and communications with the following attribution: Source: Google Project Sunroof data explorer (August 2017)."
22+
}
23+
24+
output "bigquery_dataset-sunroof_solar-dataset_id" {
25+
value = google_bigquery_dataset.sunroof_solar.dataset_id
26+
}

datasets/sunroof/dataset.yaml renamed to datasets/sunroof_solar/dataset.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
# limitations under the License.
1414

1515
dataset:
16-
name: sunroof
17-
friendly_name: sunroof
18-
description: sunroof
16+
name: sunroof_solar
17+
friendly_name: sunroof_solar
18+
description: sunroof_solar
1919
dataset_sources: ~
2020
terms_of_use: ~
2121

2222

2323
resources:
2424
- type: bigquery_dataset
25-
dataset_id: sunroof
26-
description: sunroof
25+
dataset_id: sunroof_solar
26+
description: |-
27+
Project Sunroof computes how much sunlight hits your roof in a year. Solar viability is determined using a methodology found here: https://www.google.com/get/sunroof/data-explorer/data-explorer-methodology.pdf The use of this data is subject to Google's Terms of Service. Feel free to include this data from Project Sunroof in other analyses, materials, reports, and communications with the following attribution: Source: Google Project Sunroof data explorer (August 2017).

datasets/sunroof/solar_potential_by_census_tract/pipeline.yaml renamed to datasets/sunroof_solar/solar_potential_by_censustract/pipeline.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
resources:
1717

1818
- type: bigquery_table
19-
table_id: "solar_potential_by_census_tract"
19+
table_id: "solar_potential_by_censustract"
2020
description: "Sunroof Solar Potential By Census Tract"
2121

2222
dag:
2323
airflow_version: 2
2424
initialize:
25-
dag_id: solar_potential_by_census_tract
25+
dag_id: solar_potential_by_censustract
2626
default_args:
2727
owner: "Google"
2828
depends_on_past: False
@@ -40,7 +40,7 @@ dag:
4040
args:
4141

4242
task_id: "transform_csv"
43-
name: "solar_potential_by_census_tract"
43+
name: "solar_potential_by_censustract"
4444
namespace: "default"
4545
affinity:
4646
nodeAffinity:
@@ -52,27 +52,27 @@ dag:
5252
values:
5353
- "pool-e2-standard-4"
5454
image_pull_policy: "Always"
55-
image: "{{ var.json.sunroof.container_registry.run_csv_transform_kub }}"
55+
image: "{{ var.json.sunroof_solar.container_registry.run_csv_transform_kub }}"
5656
env_vars:
5757
SOURCE_URL: "gs://project-sunroof/csv/latest/project-sunroof-census_tract.csv"
5858
SOURCE_FILE: "files/data.csv"
5959
TARGET_FILE: "files/data_output.csv"
6060
CHUNKSIZE: "750000"
6161
TARGET_GCS_BUCKET: "{{ var.value.composer_bucket }}"
62-
TARGET_GCS_PATH: "data/sunroof/solar_potential_by_census_tract/data_output.csv"
62+
TARGET_GCS_PATH: "data/sunroof/solar_potential_by_censustract/data_output.csv"
6363
resources:
6464
limit_memory: "8G"
6565
limit_cpu: "3"
6666

6767
- operator: "GoogleCloudStorageToBigQueryOperator"
68-
description: "Task to load CSV data to a BigQuery table"
68+
description: "Load CSV data to a BigQuery table"
6969

7070
args:
7171
task_id: "load_to_bq"
7272
bucket: "{{ var.value.composer_bucket }}"
73-
source_objects: ["data/sunroof/solar_potential_by_census_tract/data_output.csv"]
73+
source_objects: ["data/sunroof/solar_potential_by_censustract/data_output.csv"]
7474
source_format: "CSV"
75-
destination_project_dataset_table: "sunroof.solar_potential_by_census_tract"
75+
destination_project_dataset_table: "sunroof.solar_potential_by_censustract"
7676
skip_leading_rows: 1
7777
allow_quoted_newlines: True
7878
write_disposition: "WRITE_TRUNCATE"

datasets/sunroof/solar_potential_by_census_tract/solar_potential_by_census_tract_dag.py renamed to datasets/sunroof_solar/solar_potential_by_censustract/solar_potential_by_censustract_dag.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
with DAG(
28-
dag_id="sunroof.solar_potential_by_census_tract",
28+
dag_id="sunroof_solar.solar_potential_by_censustract",
2929
default_args=default_args,
3030
max_active_runs=1,
3131
schedule_interval="@daily",
@@ -36,7 +36,7 @@
3636
# Run CSV transform within kubernetes pod
3737
transform_csv = kubernetes_pod.KubernetesPodOperator(
3838
task_id="transform_csv",
39-
name="solar_potential_by_census_tract",
39+
name="solar_potential_by_censustract",
4040
namespace="default",
4141
affinity={
4242
"nodeAffinity": {
@@ -56,14 +56,14 @@
5656
}
5757
},
5858
image_pull_policy="Always",
59-
image="{{ var.json.sunroof.container_registry.run_csv_transform_kub }}",
59+
image="{{ var.json.sunroof_solar.container_registry.run_csv_transform_kub }}",
6060
env_vars={
6161
"SOURCE_URL": "gs://project-sunroof/csv/latest/project-sunroof-census_tract.csv",
6262
"SOURCE_FILE": "files/data.csv",
6363
"TARGET_FILE": "files/data_output.csv",
6464
"CHUNKSIZE": "750000",
6565
"TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}",
66-
"TARGET_GCS_PATH": "data/sunroof/solar_potential_by_census_tract/data_output.csv",
66+
"TARGET_GCS_PATH": "data/sunroof/solar_potential_by_censustract/data_output.csv",
6767
},
6868
resources={"limit_memory": "8G", "limit_cpu": "3"},
6969
)
@@ -72,9 +72,9 @@
7272
load_to_bq = gcs_to_bigquery.GCSToBigQueryOperator(
7373
task_id="load_to_bq",
7474
bucket="{{ var.value.composer_bucket }}",
75-
source_objects=["data/sunroof/solar_potential_by_census_tract/data_output.csv"],
75+
source_objects=["data/sunroof/solar_potential_by_censustract/data_output.csv"],
7676
source_format="CSV",
77-
destination_project_dataset_table="sunroof.solar_potential_by_census_tract",
77+
destination_project_dataset_table="sunroof.solar_potential_by_censustract",
7878
skip_leading_rows=1,
7979
allow_quoted_newlines=True,
8080
write_disposition="WRITE_TRUNCATE",

datasets/sunroof/solar_potential_by_postal_code/pipeline.yaml renamed to datasets/sunroof_solar/solar_potential_by_postal_code/pipeline.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dag:
5252
values:
5353
- "pool-e2-standard-4"
5454
image_pull_policy: "Always"
55-
image: "{{ var.json.sunroof.container_registry.run_csv_transform_kub }}"
55+
image: "{{ var.json.sunroof_solar.container_registry.run_csv_transform_kub }}"
5656
env_vars:
5757
SOURCE_URL: "gs://project-sunroof/csv/latest/project-sunroof-postal_code.csv"
5858
SOURCE_FILE: "files/data.csv"

datasets/sunroof/solar_potential_by_postal_code/solar_potential_by_postal_code_dag.py renamed to datasets/sunroof_solar/solar_potential_by_postal_code/solar_potential_by_postal_code_dag.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
with DAG(
28-
dag_id="sunroof.solar_potential_by_postal_code",
28+
dag_id="sunroof_solar.solar_potential_by_postal_code",
2929
default_args=default_args,
3030
max_active_runs=1,
3131
schedule_interval="@daily",
@@ -56,7 +56,7 @@
5656
}
5757
},
5858
image_pull_policy="Always",
59-
image="{{ var.json.sunroof.container_registry.run_csv_transform_kub }}",
59+
image="{{ var.json.sunroof_solar.container_registry.run_csv_transform_kub }}",
6060
env_vars={
6161
"SOURCE_URL": "gs://project-sunroof/csv/latest/project-sunroof-postal_code.csv",
6262
"SOURCE_FILE": "files/data.csv",

0 commit comments

Comments
 (0)