Skip to content

Commit

Permalink
Date -> FlightDate for API
Browse files Browse the repository at this point in the history
  • Loading branch information
rjurney committed Jul 29, 2017
1 parent 31c7bce commit 48cc748
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ch08/web/predict_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def regress_flight_delays():
{
"DepDelay": int,
"Carrier": str,
"Date": str,
"FlightDate": str,
"Dest": str,
"FlightNum": str,
"Origin": str
Expand All @@ -325,7 +325,7 @@ def regress_flight_delays():
prediction_features['Distance'] = predict_utils.get_flight_distance(client, api_form_values['Origin'], api_form_values['Dest'])

# Turn the date into DayOfYear, DayOfMonth, DayOfWeek
date_features_dict = predict_utils.get_regression_date_args(api_form_values['Date'])
date_features_dict = predict_utils.get_regression_date_args(api_form_values['FlightDate'])
for api_field_name, api_field_value in date_features_dict.items():
prediction_features[api_field_name] = api_field_value

Expand All @@ -346,7 +346,7 @@ def flight_delays_page():
form_config = [
{'field': 'DepDelay', 'label': 'Departure Delay'},
{'field': 'Carrier'},
{'field': 'Date'},
{'field': 'FlightDate', 'label': 'Date'},
{'field': 'Origin'},
{'field': 'Dest', 'label': 'Destination'},
{'field': 'FlightNum', 'label': 'Flight Number'},
Expand Down

0 comments on commit 48cc748

Please sign in to comment.