Skip to content

Commit e8bb8a4

Browse files
authored
update endpoint for gas prices dataset (GoogleCloudPlatform#8376)
1 parent dfd243d commit e8bb8a4

File tree

3 files changed

+807
-665
lines changed

3 files changed

+807
-665
lines changed

data-science-onramp/data-ingestion/ingestion.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,27 @@
3535
CITIBIKE_TABLE_NAME = "RAW_DATA"
3636
EXTERNAL_TABLES = {
3737
"gas_prices": {
38-
"url": "https://data.ny.gov/api/views/wuxr-ni2i/rows.csv",
38+
"url": "https://data.ny.gov/api/views/nqur-w4p7/rows.csv",
3939
"schema": StructType(
4040
[
4141
StructField("Date", StringType(), True),
4242
StructField("New_York_State_Average_USD_per_Gal", FloatType(), True),
4343
StructField("Albany_Average_USD_per_Gal", FloatType(), True),
44-
StructField("Blinghamton_Average_USD_per_Gal", FloatType(), True),
44+
StructField("Batavia_Average_USD_per_Gal", FloatType(), True),
45+
StructField("Binghamton_Average_USD_per_Gal", FloatType(), True),
4546
StructField("Buffalo_Average_USD_per_Gal", FloatType(), True),
47+
StructField("Dutchess_Average_USD_per_Gal", FloatType(), True),
48+
StructField("Elmira_Average_USD_per_Gal", FloatType(), True),
49+
StructField("Glens_Falls_Average_USD_per_Gal", FloatType(), True),
50+
StructField("Ithaca_Average_USD_per_Gal", FloatType(), True),
51+
StructField("Kingston_Average_USD_per_Gal", FloatType(), True),
4652
StructField("Nassau_Average_USD_per_Gal", FloatType(), True),
4753
StructField("New_York_City_Average_USD_per_Gal", FloatType(), True),
4854
StructField("Rochester_Average_USD_per_Gal", FloatType(), True),
4955
StructField("Syracuse_Average_USD_per_Gal", FloatType(), True),
5056
StructField("Utica_Average_USD_per_Gal", FloatType(), True),
57+
StructField("Watertown_Average_USD_per_Gal", FloatType(), True),
58+
StructField("White_Plains_Average_USD_per_Gal", FloatType(), True),
5159
]
5260
),
5361
},

data-science-onramp/feature-engineering/feature_engineering.ipynb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,22 @@
7676
" bigquery.SchemaField(\"Date\", \"STRING\"),\n",
7777
" bigquery.SchemaField(\"New_York_State_Average_USD_per_Gal\", \"FLOAT\"),\n",
7878
" bigquery.SchemaField(\"Albany_Average_USD_per_Gal\", \"FLOAT\"),\n",
79+
" bigquery.SchemaField(\"Batavia_Average_USD_per_Gal\", \"FLOAT\"),\n",
7980
" bigquery.SchemaField(\"Binghamton_Average_USD_per_Gal\", \"FLOAT\"),\n",
8081
" bigquery.SchemaField(\"Buffalo_Average_USD_per_Gal\", \"FLOAT\"),\n",
82+
" bigquery.SchemaField(\"Dutchess_Average_USD_per_Gal\"),\n",
83+
" bigquery.SchemaField(\"Elmira_Average_USD_per_Gal\", \"FLOAT\"),\n",
84+
" bigquery.SchemaField(\"Glens_Falls_Average_USD_per_Gal\", \"FLOAT\"),\n",
85+
" bigquery.SchemaField(\"Ithaca_Average_USD_per_Gal\", \"FLOAT\"),\n",
86+
" bigquery.SchemaField(\"Kingston_Average_USD_per_Gal\", \"FLOAT\"),\n",
8187
" bigquery.SchemaField(\"Nassau_Average_USD_per_Gal\", \"FLOAT\"),\n",
8288
" bigquery.SchemaField(\"New_York_City_Average_USD_per_Gal\", \"FLOAT\"),\n",
8389
" bigquery.SchemaField(\"Rochester_Average_USD_per_Gal\", \"FLOAT\"),\n",
8490
" bigquery.SchemaField(\"Syracuse_Average_USD_per_Gal\", \"FLOAT\"),\n",
8591
" bigquery.SchemaField(\"Utica_Average_USD_per_Gal\", \"FLOAT\"),\n",
92+
" bigquery.SchemaField(\"Watertown_Average_USD_per_Gal\", \"FLOAT\"),\n",
93+
" bigquery.SchemaField(\"White_Plains_Average_USD_per_Gal\", \"FLOAT\"),\n",
94+
"\n",
8695
"]\n",
8796
"write_to_bq('gas_prices', gasprices_uri, gasprices_schema)"
8897
]
@@ -1003,16 +1012,19 @@
10031012
"type": "gcloud",
10041013
"uri": "gcr.io/deeplearning-platform-release/tf2-gpu.2-3:mnightly-2021-02-12-debian-10-test"
10051014
},
1006-
"interpreter": {
1007-
"hash": "1b0ec9b1916cf0489ce214584e3f7f99b183b01cc4dc6fb00e756ec75ed889c4"
1008-
},
10091015
"kernelspec": {
1010-
"display_name": "Python 3.8.0 64-bit ('3.8.0')",
1016+
"display_name": "Python 3.8.13 64-bit ('3.8.13')",
1017+
"language": "python",
10111018
"name": "python3"
10121019
},
10131020
"language_info": {
10141021
"name": "python",
1015-
"version": ""
1022+
"version": "3.8.13"
1023+
},
1024+
"vscode": {
1025+
"interpreter": {
1026+
"hash": "26864ca88ce905de82797da54d8873376f137ee19eedffe0cbf7a315f936dc83"
1027+
}
10161028
}
10171029
},
10181030
"nbformat": 4,

0 commit comments

Comments
 (0)