Bug description
I'm getting a frontend error when trying to rendering my path data:
An error occurred while rendering the visualization: TypeError: t is undefined
The error detail doesn't give much information.
My dataset is a saved query that use a UDF called geojson_encode_path
to generate json data required by deckgl path. The result has shown up in the results path and it looks correct. If I copy the UDF output data into a new table, it works correctly so I believe the data is correct.
The SQL query sent to server while rendering:
SELECT
path AS path
FROM (
SELECT
recorder,
GEOJSON_ENCODE_PATH(lat, lon, ts) AS path
FROM caltrack
GROUP BY
recorder
) AS virtual_table
WHERE
NOT path IS NULL
GROUP BY
path
LIMIT 10000
The result:
path
---------------------------------------------------------------
--------------------
[[-118.23100280761719,34.06100082397461],[-118.23100280761719,
33.06100082397461]]
Note: the data type of UDF output is varchar
.
I didn't see any error from database or superset itself. The data is hosted in GreptimeDB, a postgres compatible database, the driver is based on original postgres' one.
Let me know if you need more information from me.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Firefox
Additional context
No response
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
The error "TypeError: t is undefined" in the context of deck.gl visualizations can be challenging to diagnose without specific details. However, here are a few things you might consider checking:
-
Data Format: Ensure that the output of your
geojson_encode_path
UDF is in the correct format expected by the deck.gl Path layer. The expected input format should match the deserialization process used in Superset, which involves JSON, polyline, or geohash formats [1]. -
Data Deserialization: Verify that the data is being deserialized correctly. Superset uses a deserialization map (
deser_map
) to handle different line types. Make sure that the data type returned by your UDF is compatible with the expected deserialization function. -
Frontend Error Handling: Superset's frontend uses an
ErrorBoundary
component to catch errors during rendering. The error "TypeError: t is undefined" might indicate an issue with how the data is being processed or rendered on the frontend. Check if there are any additional logs or error messages that might provide more context [2]. -
Database Compatibility: Since you're using a PostgreSQL-compatible database, ensure that the JSON data types are correctly mapped and handled by Superset. Superset maps JSON data types to the
JSON
type in SQLAlchemy, which should be compatible with PostgreSQL databases [3]. -
UDF Output: Since copying the UDF output data into a new table works correctly, there might be an issue with how the UDF output is being handled in the query. Double-check the query logic and ensure that the UDF output is correctly formatted and not altered during the query execution.
If these steps do not resolve the issue, consider simplifying the query or the data to isolate the problem further.
To continue talking to Dosu, mention @dosu.
Comment From: rusackas
Hey there... are you still facing this? I think it falls under the category of bugs that don't affect many folks, and require a fair amount of effort to reproduce, which is probably why it's been silent here.
Comment From: rusackas
Closing as not-planned for now, sicne it's been quiet and uncorroborated for so long, but we're happy to reopen this if others encounter it and/or anyone wants to open a PR to resolve it.