archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
213 stars 142 forks source link

sql syntax error in __arches_load_staging_get_tile_errors(jsonb) function #10867

Open whatisgalen opened 4 months ago

whatisgalen commented 4 months ago

While running an etl module operation, the error handling broke on this syntax error in the sql function:

psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type json
LINE 1: _result := '|' || _value ->> 'notes'
                   ^
DETAIL:  Token "|" is invalid.
QUERY:  _result := '|' || _value ->> 'notes'
CONTEXT:  JSON data, line 1: |
PL/pgSQL function __arches_load_staging_get_tile_errors(jsonb) line 20 at assignment

The error occurs because it's attempting to concatenate _result (which might be null) with a null value extracted from _value ->> 'notes'

jacobtylerwalls commented 4 months ago

Thanks Galen. Housekeeping: we have another label called Type: Bulk Data Manager with more issues on it. Do you think we can choose one and delete the other?

whatisgalen commented 4 months ago

For sure!