You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "damirbk (via GitHub)" <gi...@apache.org> on 2025/07/02 09:19:12 UTC
[I] World map chart type changes country code format in dashboard filter [superset]
damirbk opened a new issue, #34024:
URL: https://github.com/apache/superset/issues/34024
### Bug description
I have a dataset with ISO 3166 alpha-2 (cca2) country codes. I can create a world map just fine with this. However, when I click on certain countries to filter in a dashboard, the filter applies the corresponding ISO 3166 alpha-3 (cca3) country code, rendering the filter useless.
Steps to reproduce:
1. Make a dataset with cca2 country codes (e.g. 'CA', 'ZA', etc.)
2. Create a World Map chart based on that dataset, choose cca2 country codes for the "Country field type" and Save.
3. Add the World Map chart to a dashboard.
4. Add another chart that has cca2 country codes in the dataset.
5. Click on a country in the World Map chart, e.g. Canada. No rows will show in the other chart. After inspection through "View query", you will see that the filter that was applied was 'CAN' instead of 'CA'.
### Screenshots/recordings
_No response_
### Superset version
4.1.2
### Python version
3.9
### Node version
16
### Browser
Chrome
### 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "damirbk (via GitHub)" <gi...@apache.org>.
damirbk commented on issue #34024:
URL: https://github.com/apache/superset/issues/34024#issuecomment-3236225669
I had some time to do some digging. The mapping between country code and country name is imported from the Datamaps package and there's a related issue (albeit old) here: https://github.com/markmarkoh/datamaps/issues/28. There seems to be no plan to introduce flexibility to Datamaps to use different types of country codes.
@clhubert workaround could to be to re-map your 2 digit codes to 3 digit codes in your dataset using e.g. https://country.io/iso3.json.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro closed issue #34024: World map chart type changes country code format in dashboard filter
URL: https://github.com/apache/superset/issues/34024
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #34024:
URL: https://github.com/apache/superset/issues/34024#issuecomment-3387195878
Hi @yong1le , please go for it! Doesn't sound like anyone else is working on this and a fix would be appreciated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "clhubert (via GitHub)" <gi...@apache.org>.
clhubert commented on issue #34024:
URL: https://github.com/apache/superset/issues/34024#issuecomment-3235386153
Is there a workaround?
Do we just have to ONLY pass the 3 digit country code when doing cross filters?
Does the name of the field need to match? Be some specific name?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #34024:
URL: https://github.com/apache/superset/issues/34024#issuecomment-3027112843
<!-- Answer -->
This is a known issue with the World Map chart: even if you select ISO 3166 alpha-2 (cca2) codes for your dataset and chart, clicking a country in the map emits a filter using the alpha-3 (cca3) code. This happens because the frontend plugin logic does not consistently use the selected "country field type" when emitting filter values for dashboard filters, causing a mismatch if your other charts expect cca2 codes. There is currently no user-facing configuration or documented workaround to force the World Map chart to emit filter values in the same code format as your dataset, and this behavior is not documented in the official docs or tracked in existing issues or pull requests. The relevant code is in the frontend plugin for the World Map chart, specifically in how it constructs the filter value for cross-filtering based on the country field type you select, but it does not always honor your selection for emitted filter values, leading to this bug.
You can review the relevant implementation details in the chart plugin code [here](https://github.com/apache/superset/blob/308007f909b5a3c1cdd6fc5632ef27ca7eb97ce0/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ede21287-6d58-444d-bd02-4dd53cb429f0?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [!
[Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34024)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #34024:
URL: https://github.com/apache/superset/issues/34024#issuecomment-3053400779
Really? I didn't know about that! PR's welcome obviously, as this sounds pretty goofy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] World map chart type changes country code format in dashboard filter [superset]
Posted by "yong1le (via GitHub)" <gi...@apache.org>.
yong1le commented on issue #34024:
URL: https://github.com/apache/superset/issues/34024#issuecomment-3368532346
Hello @rusackas @damirbk
I've been able to reproduce this issue on the latest master. It seems that part of the problem is because the world map plugin only checks for country name and `cca2` field types with doing cross filtering, so this issue may also affect a few `cioc` codes. I would like to attempt a fix on this issue with my team over the next couple of weeks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org