Open SamEdwardes opened 2 months ago
For reference, I am getting the following error when when trying to call the API with data in these fields:
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/src/module_model_explorer.py", line 301, in predicted_delay_text
return f"{predict_delay()} minutes"
^^^^^^^^^^^^^^^
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/.venv/lib/python3.12/site-packages/shiny/reactive/_reactives.py", line 284, in __call__
return _utils.run_coro_sync(self.get_value())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/.venv/lib/python3.12/site-packages/shiny/_utils.py", line 381, in run_coro_sync
coro.send(None)
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/.venv/lib/python3.12/site-packages/shiny/reactive/_reactives.py", line 294, in get_value
raise self._error[0]
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/.venv/lib/python3.12/site-packages/shiny/reactive/_reactives.py", line 329, in _run_func
self._value.append(await self._fn())
^^^^^^^^^^^^^^^^
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/.venv/lib/python3.12/site-packages/shiny/_utils.py", line 263, in fn_async
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/src/module_model_explorer.py", line 275, in predict_delay
prediction_results = predict(
^^^^^^^^
File "/Users/samedwardes/projects/posit/ds-workflows-python-2024/materials/05-shiny-app/.venv/lib/python3.12/site-packages/vetiver/server.py", line 348, in predict
raise TypeError(re.sub(r"\n", ": ", response.text))
TypeError: [{'type': 'none_required', 'loc': ('body', 0, 'PassengerOnly'), 'msg': 'Input should be None', 'input': False}, {'type': 'none_required', 'loc': ('body', 0, 'FastFerry'), 'msg': 'Input should be None', 'input': False}, {'type': 'none_required', 'loc': ('body', 0, 'departing_precipitation'), 'msg': 'Input should be None', 'input': 0}, {'type': 'none_required', 'loc': ('body', 0, 'arriving_precipitation'), 'msg': 'Input should be None', 'input': 0}]
Oddly enough, it looks like the data going in has no nulls:
from vetiver import VetiverModel
v = VetiverModel(
model, model_name=f"{username}/ferry_delay", prototype_data=X.to_pandas()
)
X.null_count()
Departing | Arriving | Month | Weekday | Hour | ClassName | SpeedInKnots | EngineCount | Horsepower | MaxPassengerCount | PassengerOnly | FastFerry | PropulsionInfo | YearBuilt | YearRebuilt | departing_weather_code | departing_temperature_2m | departing_precipitation | departing_cloud_cover | departing_wind_speed_10m | departing_wind_direction_10m | departing_wind_gusts_10m | arriving_weather_code | arriving_temperature_2m | arriving_precipitation | arriving_cloud_cover | arriving_wind_speed_10m | arriving_wind_direction_10m | arriving_wind_gusts_10m |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 | u32 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
X.to_pandas().isnull().sum()
Departing 0
Arriving 0
Month 0
Weekday 0
Hour 0
ClassName 0
SpeedInKnots 0
EngineCount 0
Horsepower 0
MaxPassengerCount 0
PassengerOnly 0
FastFerry 0
PropulsionInfo 0
YearBuilt 0
YearRebuilt 0
departing_weather_code 0
departing_temperature_2m 0
departing_precipitation 0
departing_cloud_cover 0
departing_wind_speed_10m 0
departing_wind_direction_10m 0
departing_wind_gusts_10m 0
arriving_weather_code 0
arriving_temperature_2m 0
arriving_precipitation 0
arriving_cloud_cover 0
arriving_wind_speed_10m 0
arriving_wind_direction_10m 0
arriving_wind_gusts_10m 0
dtype: int64
I've redeployed the vetiver model a couple of times and the nulls do reproduce.
@brooklynbagel I noticed several of the model inputs have null value types:
PassengerOnly
FastFerry
arriving_precipitation
departing_precipitation
I think this could mean that there is no data in these fields. Can you please look into this?