Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Read MAPBOX_API_KEY from environment #16926

Merged
merged 5 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ SUPERSET_ENV=development
SUPERSET_LOAD_EXAMPLES=yes
CYPRESS_CONFIG=false
SUPERSET_PORT=8088
MAPBOX_API_KEY=''
1 change: 1 addition & 0 deletions docker/.env-non-dev
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ SUPERSET_ENV=production
SUPERSET_LOAD_EXAMPLES=yes
CYPRESS_CONFIG=false
SUPERSET_PORT=8088
MAPBOX_API_KEY=''
2 changes: 1 addition & 1 deletion docker/pythonpath_dev/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_env_variable(var_name: str, default: Optional[str] = None) -> str:
)
raise EnvironmentError(error_msg)


MAPBOX_API_KEY = get_env_variable("MAPBOX_API_KEY")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@Lawful2002 Lawful2002 Dec 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure if this duplication is required or not, if I'm being honest. However as the API key is already getting fetched in https://github.com/apache/superset/blob/master/superset/config.py#L695, this duplication may not be required. That said though, the linked issue (#16781) asked MAPBOX_API_KEY = get_env_variable("MAPBOX_API_KEY") to be added to docker/pythonpath_dev/superset_config.py. Also the documentation at https://github.com/apache/superset/blob/a330b664c13e34a4c7ca954f9a3a527a43a5535f/docs/src/pages/docs/frequently-asked-questions-page.mdx#why-is-the-map-not-visible-in-the-geospatial-visualization wants that key in that particular file/location.

DATABASE_DIALECT = get_env_variable("DATABASE_DIALECT")
DATABASE_USER = get_env_variable("DATABASE_USER")
DATABASE_PASSWORD = get_env_variable("DATABASE_PASSWORD")
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/frequently-asked-questions-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SUPERSET_WEBSERVER_TIMEOUT = 60
### Why is the map not visible in the geospatial visualization?

You need to register a free account at [Mapbox.com](https://www.mapbox.com), obtain an API key, and add it
to **superset_config.py** at the key MAPBOX_API_KEY:
to **.env** and **.env-non-dev** at the key MAPBOX_API_KEY:

```
MAPBOX_API_KEY = "longstringofalphanumer1c"
Expand Down