inbo / alien-species-portal

Portal for alien and invasive species indicators
MIT License
0 stars 0 forks source link

Timeout when looking at Ondatra zibethicus species information page #67

Closed SanderDevisscher closed 8 months ago

SanderDevisscher commented 10 months ago

Describe the bug When looking at the Ondatra zibethicus species information page using docker I get a timeout. See docker logs below:

2023-12-06 13:06:30 Warning: Error in set: RHS of assignment to existing column 'GEWEST' is zero length but not NULL. If you intend to delete the column use NULL. Otherwise, the RHS must have length > 0; e.g., NA_integer_. If you are trying to change the column type to be an empty list column then, as with all column type changes, provide a full length RHS vector such as vector('list',nrow(DT)); i.e., 'plonk' in the new column.
2023-12-06 13:06:30   72: set
2023-12-06 13:06:30   71: $<-.data.table
2023-12-06 13:06:30   69: <reactive>
2023-12-06 13:06:30   53: results$species_managementData
2023-12-06 13:06:30   46: observe
2023-12-06 13:06:30   45: <observer>
2023-12-06 13:06:30    2: runApp
2023-12-06 13:06:30    1: alienSpecies::runShiny

To Reproduce Steps to reproduce the behavior:

  1. Go to 'species information'
  2. Scroll down to 'Ondatra zibethicus'
  3. See error

Expected behavior Species information page loads without timeout.

Additional context Other species pages with management don't have this issue.

Edit: Oxyura jamaicensis has an other error, namely:

2023-12-06 13:18:16 Warning: Error in [.data.frame: undefined columns selected
2023-12-06 13:18:16   54: stop
2023-12-06 13:18:16   53: [.data.frame
2023-12-06 13:18:16   51: [.sf
2023-12-06 13:18:16   47: combineActiveData
2023-12-06 13:18:16   46: observe
2023-12-06 13:18:16   45: <observer>
2023-12-06 13:18:16    2: runApp
2023-12-06 13:18:16    1: alienSpecies::runShiny

I think this is due to not having a "GEWEST" column in the data. However it has the isFlanders, isWallonia, isBrussels columns all missing from Lithobates catesbeianus which does not cause a timeout.

Yingjie-ZhangOA commented 10 months ago

The issue for Ondatra zibethicus is due to missing column NISCODE, which is used to extract GEWEST information. However Ondatra zibethicus data comes directly with GEWEST, so I switch to read directly from the data rather than via NISCODE.

For xyura jamaicensis, it's due to small bug in my code when assigning NA to radius when it's missing.

Normally issues for both have been fixed.

SanderDevisscher commented 9 months ago

This issue is mostly fixed however there still seems to be an issue when trying to select catch per unit of effort at the map.

Yingjie-ZhangOA commented 9 months ago

Cause: https://github.com/inbo/alien-species-portal/blob/295d8f261ce2f97890955e2c169d1ce82229df66/alienSpecies/R/mapRegions.R#L58 eventID is not present in the data

eventID went missing in the latest version of _Ondatrazibethicus.csv on bucket

Files changed: M data/output/UAT_direct/Ondatra_zibethicus.csv