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

Conversation

Lawful2002
Copy link
Contributor

SUMMARY

This PR fixes: #16781

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Added MAPBOX_API_KEY = get_env_variable("MAPBOX_API_KEY") in superset_config.py
  2. added MAPBOX_API_KEY='' in docker/.env and docker/.env-non-dev
  3. Updated docs 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

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@Lawful2002 Lawful2002 changed the title [WIP] fix: Read MAPBOX_API_KEY from environment): [WIP] fix: Read MAPBOX_API_KEY from environment Sep 30, 2021
@Lawful2002 Lawful2002 changed the title [WIP] fix: Read MAPBOX_API_KEY from environment fix: Read MAPBOX_API_KEY from environment Oct 1, 2021
@Lawful2002 Lawful2002 closed this Oct 4, 2021
@Lawful2002 Lawful2002 reopened this Oct 4, 2021
@Lawful2002
Copy link
Contributor Author

@junlincc Hey, the workflow tests haven't started on their own in a while. Would it be possible to manually start these tests?

@villebro
Copy link
Member

@Lawful2002 I closed/reopened the PR, now CI checks seem to have started correctly, sorry for the delay. Will take a look once tests complete.

Copy link
Contributor

@riahk riahk left a comment

Choose a reason for hiding this comment

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

LGTM once pre-commit is passing!

@jakubczaplicki
Copy link
Contributor

Hey @Lawful2002 , there's only black formatting to fix and this PR can be merged as it's approved. It would be super useful to have it :)

@@ -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.

@Lawful2002
Copy link
Contributor Author

Hey @Lawful2002 , there's only black formatting to fix and this PR can be merged as it's approved. It would be super useful to have it :)

I've fixed the formatting. Sorry for the delay

@jakubczaplicki
Copy link
Contributor

image

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 16, 2022
@frafra
Copy link
Contributor

frafra commented Apr 18, 2022

Not stale.

@stale stale bot removed the inactive Inactive for >= 30 days label Apr 18, 2022
@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

Merging #16926 (a330b66) into master (c8fe518) will increase coverage by 10.76%.
The diff coverage is n/a.

❗ Current head a330b66 differs from pull request most recent head cf71b04. Consider uploading reports for the commit cf71b04 to get more accurate results

@@             Coverage Diff             @@
##           master   #16926       +/-   ##
===========================================
+ Coverage   66.47%   77.24%   +10.76%     
===========================================
  Files        1727      973      -754     
  Lines       64724    50523    -14201     
  Branches     6822     6184      -638     
===========================================
- Hits        43024    39025     -3999     
+ Misses      19969    11292     -8677     
+ Partials     1731      206     -1525     
Flag Coverage Δ
hive 81.43% <0.00%> (+27.74%) ⬆️
javascript 71.76% <0.00%> (+20.41%) ⬆️
mysql 81.70% <0.00%> (-0.46%) ⬇️
postgres 81.72% <0.00%> (-0.50%) ⬇️
presto 81.42% <0.00%> (+27.86%) ⬆️
python 82.25% <0.00%> (-0.39%) ⬇️
sqlite 81.36% <0.00%> (-0.60%) ⬇️
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/setup/setupPlugins.ts 0.00% <0.00%> (-100.00%) ⬇️
...-frontend/src/visualizations/presets/MainPreset.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/components/Select/Select.tsx 0.00% <0.00%> (-87.29%) ⬇️
...c/visualizations/FilterBox/FilterBoxChartPlugin.js 0.00% <0.00%> (-66.67%) ⬇️
...ntend/src/explore/components/ExploreChartPanel.jsx 16.66% <0.00%> (-57.53%) ⬇️
...tend/src/filters/components/Select/controlPanel.ts 58.33% <0.00%> (-41.67%) ⬇️
superset-frontend/src/utils/hostNamesConfig.js 33.33% <0.00%> (-40.01%) ⬇️
superset/migrations/shared/utils.py 0.00% <0.00%> (-36.18%) ⬇️
...uperset-frontend/src/components/Form/FormLabel.tsx 64.70% <0.00%> (-35.30%) ⬇️
superset-frontend/src/featureFlags.ts 66.66% <0.00%> (-33.34%) ⬇️
... and 1775 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@frafra
Copy link
Contributor

frafra commented Apr 28, 2022

@Lawful2002 there are some conflicts at the moment

@rusackas
Copy link
Member

Wow, I'm not sure how this PR fell between the couch cushions for so long, but I'd love to merge this and close the related issue! I'm going to close the PR and re-open it to kick-start the CI process. Then feel free to nag me or others here or on Slack to get this thing merged!

@rusackas rusackas closed this Jan 14, 2023
@rusackas rusackas reopened this Jan 14, 2023
@rusackas rusackas merged commit 0870a0b into apache:master Jan 17, 2023
@mistercrunch mistercrunch added 🚢 2.1.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read MAPBOX_API_KEY from environment
10 participants