File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
airflow/plugins/operators Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
import gzip
2
2
import logging
3
-
4
- # import os
3
+ import os
5
4
from typing import ClassVar , List
6
5
7
6
import pandas as pd # type: ignore
12
11
13
12
from airflow .models import BaseOperator # type: ignore
14
13
15
- API_BUCKET = "gs://calitp-state-geoportal-scrape"
16
- # API_BUCKET = os.environ["CALITP_BUCKET__STATE_GEOPORTAL_DATA_PRODUCTS"]
14
+ API_BUCKET = os .environ ["CALITP_BUCKET__STATE_GEOPORTAL_DATA_PRODUCTS" ]
17
15
18
16
19
17
class StateGeoportalAPIExtract (PartitionedGCSArtifact ):
@@ -88,7 +86,8 @@ def fetch_from_state_geoportal(self):
88
86
params ["resultOffset" ] = offset
89
87
90
88
# Make the request
91
- response = requests .get (validated_url , params = params ).raise_for_status ()
89
+ response = requests .get (validated_url , params = params )
90
+ response .raise_for_status ()
92
91
data = response .json ()
93
92
94
93
# Break the loop if there are no more features
@@ -187,7 +186,7 @@ def execute(self, **kwargs):
187
186
df = pd .json_normalize (api_content )
188
187
189
188
if self .product == "state_highway_network" :
190
- # Select columns to keep, have to be explicit because there are duplicate values after normalizing
189
+ # Select columns to keep, have to be explicit before renaming because there are duplicate values after normalizing
191
190
df = df [
192
191
[
193
192
"properties.Route" ,
You can’t perform that action at this time.
0 commit comments