From 0d12e369514204c18a4d7dd961d4a1f278395839 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Tue, 23 Nov 2021 15:19:59 -0800 Subject: [PATCH 1/9] init --- superset-frontend/test.json | 683 ++++++++++++++++++ superset/config.py | 8 +- ...dd_selected_components_column_to_alerts.py | 48 ++ superset/models/alerts.py | 18 +- 4 files changed, 751 insertions(+), 6 deletions(-) create mode 100644 superset-frontend/test.json create mode 100644 superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py diff --git a/superset-frontend/test.json b/superset-frontend/test.json new file mode 100644 index 0000000000000..72d16b749d2c2 --- /dev/null +++ b/superset-frontend/test.json @@ -0,0 +1,683 @@ +{ + "CHART--0GPGmD-pO": { + "children": [], + "id": "CHART--0GPGmD-pO", + "meta": { + "chartId": 119, + "height": 48, + "sliceName": "Current Developers: Is this your first development job?", + "sliceNameOverride": "Is this your first development job?", + "uuid": "bfe5a8e6-146f-ef59-5e6c-13d519b236a8", + "width": 2 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-b7USYEngT" + ], + "type": "CHART" + }, + "CHART--w_Br1tPP3": { + "children": [], + "id": "CHART--w_Br1tPP3", + "meta": { + "chartId": 97, + "height": 51, + "sliceName": "\u2708\ufe0f Relocation ability", + "uuid": "a6dd2d5a-2cdc-c8ec-f30c-85920f4f8a65", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW-DR80aHJA2c" + ], + "type": "CHART" + }, + "CHART-0-zzTwBINh": { + "children": [], + "id": "CHART-0-zzTwBINh", + "meta": { + "chartId": 90, + "height": 49, + "sliceName": "Last Year Income Distribution", + "uuid": "a2ec5256-94b4-43c4-b8c7-b83f70c5d4df", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-b7USYEngT" + ], + "type": "CHART" + }, + "CHART-37fu7fO6Z0": { + "children": [], + "id": "CHART-37fu7fO6Z0", + "meta": { + "chartId": 128, + "height": 69, + "sliceName": "Degrees vs Income", + "uuid": "02f546ae-1bf4-bd26-8bc2-14b9279c8a62", + "width": 7 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-kNjtGVFpp" + ], + "type": "CHART" + }, + "CHART-5QwNlSbXYU": { + "children": [], + "id": "CHART-5QwNlSbXYU", + "meta": { + "chartId": 94, + "height": 69, + "sliceName": "Commute Time", + "uuid": "097c05c9-2dd2-481d-813d-d6c0c12b4a3d", + "width": 5 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-kNjtGVFpp" + ], + "type": "CHART" + }, + "CHART-FKuVqq4kaA": { + "children": [], + "id": "CHART-FKuVqq4kaA", + "meta": { + "chartId": 139, + "height": 50, + "sliceName": "Work Location Preference", + "sliceNameOverride": "Work Location Preference", + "uuid": "e6b09c28-98cf-785f-4caf-320fd4fca802", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW-DR80aHJA2c" + ], + "type": "CHART" + }, + "CHART-JnpdZOhVer": { + "children": [], + "id": "CHART-JnpdZOhVer", + "meta": { + "chartId": 95, + "height": 50, + "sliceName": "Highest degree held", + "uuid": "9f7d2b9c-6b3a-69f9-f03e-d3a141514639", + "width": 2 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW--BIzjz9F0", + "COLUMN-IEKAo_QJlz" + ], + "type": "CHART" + }, + "CHART-LjfhrUkEef": { + "children": [], + "id": "CHART-LjfhrUkEef", + "meta": { + "chartId": 87, + "height": 68, + "sliceName": "First Time Developer & Commute Time", + "uuid": "067c4a1e-ae03-4c0c-8e2a-d2c0f4bf43c3", + "width": 5 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-s3l4os7YY" + ], + "type": "CHART" + }, + "CHART-Q3pbwsH3id": { + "children": [], + "id": "CHART-Q3pbwsH3id", + "meta": { + "chartId": 85, + "height": 50, + "sliceName": "Are you an ethnic minority in your city?", + "sliceNameOverride": "Minority Status (in their city)", + "uuid": "def07750-b5c0-0b69-6228-cb2330916166", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-mOvr_xWm1" + ], + "type": "CHART" + }, + "CHART-QVql08s5Bv": { + "children": [], + "id": "CHART-QVql08s5Bv", + "meta": { + "chartId": 100, + "height": 50, + "sliceName": "First Time Developer?", + "uuid": "edc75073-8f33-4123-a28d-cd6dfb33cade", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-b7USYEngT" + ], + "type": "CHART" + }, + "CHART-UtSaz4pfV6": { + "children": [], + "id": "CHART-UtSaz4pfV6", + "meta": { + "chartId": 106, + "height": 50, + "sliceName": "Age distribution of respondents", + "uuid": "5f1ea868-604e-f69d-a241-5daa83ff33be", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-UsW-_RPAb", + "COLUMN-OJ5spdMmNh" + ], + "type": "CHART" + }, + "CHART-VvFbGxi3X_": { + "children": [], + "id": "CHART-VvFbGxi3X_", + "meta": { + "chartId": 117, + "height": 62, + "sliceName": "Top 15 Languages Spoken at Home", + "uuid": "03a74c97-52fc-cf87-233c-d4275f8c550c", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-UsW-_RPAb", + "COLUMN-OJ5spdMmNh" + ], + "type": "CHART" + }, + "CHART-XHncHuS5pZ": { + "children": [], + "id": "CHART-XHncHuS5pZ", + "meta": { + "chartId": 132, + "height": 41, + "sliceName": "Number of Aspiring Developers", + "sliceNameOverride": "What type of work would you prefer?", + "uuid": "a0e5329f-224e-6fc8-efd2-d37d0f546ee8", + "width": 2 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW-DR80aHJA2c" + ], + "type": "CHART" + }, + "CHART-YSzS5GOOLf": { + "children": [], + "id": "CHART-YSzS5GOOLf", + "meta": { + "chartId": 131, + "height": 54, + "sliceName": "Ethnic Minority & Gender", + "uuid": "4880e4f4-b701-4be0-86f3-e7e89432e83b", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-mOvr_xWm1" + ], + "type": "CHART" + }, + "CHART-ZECnzPz8Bi": { + "children": [], + "id": "CHART-ZECnzPz8Bi", + "meta": { + "chartId": 101, + "height": 74, + "sliceName": "Location of Current Developers", + "uuid": "5596e0f6-78a9-465d-8325-7139c794a06a", + "width": 7 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-s3l4os7YY" + ], + "type": "CHART" + }, + "CHART-aytwlT4GAq": { + "children": [], + "id": "CHART-aytwlT4GAq", + "meta": { + "chartId": 118, + "height": 50, + "sliceName": "Breakdown of Developer Type", + "uuid": "b8386be8-f44e-6535-378c-2aa2ba461286", + "width": 4 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-y-GwJPgxLr" + ], + "type": "CHART" + }, + "CHART-d6vjW6rC6V": { + "children": [], + "id": "CHART-d6vjW6rC6V", + "meta": { + "chartId": 112, + "height": 54, + "sliceName": "Filter Segments", + "sliceNameOverride": "Filter By", + "uuid": "6420629a-ce74-2c6b-ef7d-b2e78baa3cfe", + "width": 5 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-y-GwJPgxLr" + ], + "type": "CHART" + }, + "CHART-fLpTSAHpAO": { + "children": [], + "id": "CHART-fLpTSAHpAO", + "meta": { + "chartId": 134, + "height": 118, + "sliceName": "Country of Citizenship", + "uuid": "2ba66056-a756-d6a3-aaec-0c243fb7062e", + "width": 9 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-UsW-_RPAb" + ], + "type": "CHART" + }, + "CHART-lQVSAw0Or3": { + "children": [], + "id": "CHART-lQVSAw0Or3", + "meta": { + "chartId": 120, + "height": 100, + "sliceName": "How do you prefer to work?", + "sliceNameOverride": "Preferred Employment Style vs Degree", + "uuid": "cb8998ab-9f93-4f0f-4e4b-3bfe4b0dea9d", + "width": 4 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW--BIzjz9F0" + ], + "type": "CHART" + }, + "CHART-o-JPAWMZK-": { + "children": [], + "id": "CHART-o-JPAWMZK-", + "meta": { + "chartId": 136, + "height": 50, + "sliceName": "Gender", + "uuid": "0f6b447c-828c-e71c-87ac-211bc412b214", + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-mOvr_xWm1" + ], + "type": "CHART" + }, + "CHART-v22McUFMtx": { + "children": [], + "id": "CHART-v22McUFMtx", + "meta": { + "chartId": 96, + "height": 52, + "sliceName": "How much do you expect to earn? ($0 - 100k)", + "sliceNameOverride": "\ud83d\udcb2Expected Income (excluding outliers)", + "uuid": "6d0ceb30-2008-d19c-d285-cf77dc764433", + "width": 4 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW--BIzjz9F0", + "COLUMN-IEKAo_QJlz" + ], + "type": "CHART" + }, + "CHART-wxWVtlajRF": { + "children": [], + "id": "CHART-wxWVtlajRF", + "meta": { + "chartId": 81, + "height": 104, + "sliceName": "Preferred Employment Style", + "uuid": "bff88053-ccc4-92f2-d6f5-de83e950e8cd", + "width": 4 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW--BIzjz9F0" + ], + "type": "CHART" + }, + "COLUMN-IEKAo_QJlz": { + "children": ["CHART-JnpdZOhVer", "CHART-v22McUFMtx"], + "id": "COLUMN-IEKAo_QJlz", + "meta": { "background": "BACKGROUND_TRANSPARENT", "width": 4 }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW--BIzjz9F0" + ], + "type": "COLUMN" + }, + "COLUMN-OJ5spdMmNh": { + "children": ["CHART-VvFbGxi3X_", "CHART-UtSaz4pfV6"], + "id": "COLUMN-OJ5spdMmNh", + "meta": { "background": "BACKGROUND_TRANSPARENT", "width": 3 }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-UsW-_RPAb" + ], + "type": "COLUMN" + }, + "DASHBOARD_VERSION_KEY": "v2", + "GRID_ID": { + "children": ["TABS-L-d9eyOE-b"], + "id": "GRID_ID", + "parents": ["ROOT_ID"], + "type": "GRID" + }, + "HEADER_ID": { + "id": "HEADER_ID", + "meta": { "text": "FCC New Coder Survey 2018" }, + "type": "HEADER" + }, + "MARKDOWN-BUmyHM2s0x": { + "children": [], + "id": "MARKDOWN-BUmyHM2s0x", + "meta": { + "code": "# Aspiring Developers\n\nThe mission of FreeCodeCamp is to \"help people learn to code for free\". With this in mind, it's no surprise that ~83% of this survey's respondents fall into the **Aspiring Developer** category.\n\nIn this tab, we use visualization to explore:\n\n- Interest in relocating for work\n- Preferences around work location & style\n- Distribution of expected income\n- Distribution of highest degree held\n- Heatmap of highest degree held vs employment style preference", + "height": 50, + "width": 4 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-YT6eNksV-", + "ROW-DR80aHJA2c" + ], + "type": "MARKDOWN" + }, + "MARKDOWN-NQmSPDOtpl": { + "children": [], + "id": "MARKDOWN-NQmSPDOtpl", + "meta": { + "code": "# Current Developers\n\nWhile majority of the students on FCC are Aspiring developers, there's a nontrivial minority that's there to continue leveling up their skills (17% of the survey respondents).\n\nBased on how respondents self-identified in the start of the survey, they were asked different questions. In this tab, we use visualizations to explore:\n\n- The buckets of commute team these developers encounter\n- The proportion of developers whose current job is their first developer job\n- Distribution of last year's income\n- The geographic distribution of these developers\n- The overlap between commute time and if their current job is their first developer job\n- Potential link between highest degree earned and last year's income", + "height": 50, + "width": 4 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "ROW-b7USYEngT" + ], + "type": "MARKDOWN" + }, + "MARKDOWN-__u6CsUyfh": { + "children": [], + "id": "MARKDOWN-__u6CsUyfh", + "meta": { + "code": "## FreeCodeCamp New Coder Survey 2018\n\nEvery year, FCC surveys its user base (mostly budding softwware developers) to learn more about their interests, backgrounds, goals, job status, and socioeconomic features. This dashboard visualizes survey data from the 2018 survey.\n\n- [Survey link](https://freecodecamp.typeform.com/to/S3UeD9)\n- [Dataset](https://github.com/freeCodeCamp/2018-new-coder-survey)\n- [FCC Blog Post](https://www.freecodecamp.org/news/we-asked-20-000-people-who-they-are-and-how-theyre-learning-to-code-fff5d668969/)", + "height": 45, + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-y-GwJPgxLr" + ], + "type": "MARKDOWN" + }, + "MARKDOWN-zc2mWxZeox": { + "children": [], + "id": "MARKDOWN-zc2mWxZeox", + "meta": { + "code": "# Demographics\n\nFreeCodeCamp is a completely-online community of people learning to code and consists of aspiring & current developers from all over the world. That doesn't necessarily mean that acccess to these types of opportunities are evenly distributed. \n\nThe following charts can begin to help us understand:\n\n- the original citizenship of the survey respondents\n- minority representation among both aspiring and current developers\n- their age distribution\n- household languages", + "height": 52, + "width": 3 + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-AsMaxdYL_t", + "ROW-mOvr_xWm1" + ], + "type": "MARKDOWN" + }, + "ROOT_ID": { "children": ["GRID_ID"], "id": "ROOT_ID", "type": "ROOT" }, + "ROW--BIzjz9F0": { + "children": ["COLUMN-IEKAo_QJlz", "CHART-lQVSAw0Or3", "CHART-wxWVtlajRF"], + "id": "ROW--BIzjz9F0", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-YT6eNksV-"], + "type": "ROW" + }, + "ROW-DR80aHJA2c": { + "children": [ + "MARKDOWN-BUmyHM2s0x", + "CHART-XHncHuS5pZ", + "CHART--w_Br1tPP3", + "CHART-FKuVqq4kaA" + ], + "id": "ROW-DR80aHJA2c", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-YT6eNksV-"], + "type": "ROW" + }, + "ROW-UsW-_RPAb": { + "children": ["COLUMN-OJ5spdMmNh", "CHART-fLpTSAHpAO"], + "id": "ROW-UsW-_RPAb", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-AsMaxdYL_t"], + "type": "ROW" + }, + "ROW-b7USYEngT": { + "children": [ + "MARKDOWN-NQmSPDOtpl", + "CHART--0GPGmD-pO", + "CHART-QVql08s5Bv", + "CHART-0-zzTwBINh" + ], + "id": "ROW-b7USYEngT", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], + "type": "ROW" + }, + "ROW-kNjtGVFpp": { + "children": ["CHART-5QwNlSbXYU", "CHART-37fu7fO6Z0"], + "id": "ROW-kNjtGVFpp", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], + "type": "ROW" + }, + "ROW-mOvr_xWm1": { + "children": [ + "MARKDOWN-zc2mWxZeox", + "CHART-Q3pbwsH3id", + "CHART-o-JPAWMZK-", + "CHART-YSzS5GOOLf" + ], + "id": "ROW-mOvr_xWm1", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-AsMaxdYL_t"], + "type": "ROW" + }, + "ROW-s3l4os7YY": { + "children": ["CHART-LjfhrUkEef", "CHART-ZECnzPz8Bi"], + "id": "ROW-s3l4os7YY", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], + "type": "ROW" + }, + "ROW-y-GwJPgxLr": { + "children": ["MARKDOWN-__u6CsUyfh", "CHART-aytwlT4GAq", "CHART-d6vjW6rC6V"], + "id": "ROW-y-GwJPgxLr", + "meta": { "background": "BACKGROUND_TRANSPARENT" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-AsMaxdYL_t"], + "type": "ROW" + }, + "TAB-AsMaxdYL_t": { + "children": ["ROW-y-GwJPgxLr", "ROW-mOvr_xWm1", "ROW-UsW-_RPAb"], + "id": "TAB-AsMaxdYL_t", + "meta": { "text": "Overview" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b"], + "type": "TAB" + }, + "TAB-YT6eNksV-": { + "children": ["ROW-DR80aHJA2c", "ROW--BIzjz9F0"], + "id": "TAB-YT6eNksV-", + "meta": { "text": "\ud83d\ude80 Aspiring Developers" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b"], + "type": "TAB" + }, + "TAB-ZJBCsguEk": { + "children": [], + "id": "TAB-ZJBCsguEk", + "meta": { + "defaultText": "Tab title", + "placeholder": "Tab title", + "text": "Drill down" + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "TABS-o2bzbhFhZA" + ], + "type": "TAB" + }, + "TAB-l_9I0aNYZ": { + "children": [ + "TABS-o2bzbhFhZA", + "ROW-b7USYEngT", + "ROW-kNjtGVFpp", + "ROW-s3l4os7YY" + ], + "id": "TAB-l_9I0aNYZ", + "meta": { "text": "\ud83d\udcbb Current Developers" }, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b"], + "type": "TAB" + }, + "TAB-w0LzrqxZqF": { + "children": [], + "id": "TAB-w0LzrqxZqF", + "meta": { + "defaultText": "Tab title", + "placeholder": "Tab title", + "text": "Overview" + }, + "parents": [ + "ROOT_ID", + "GRID_ID", + "TABS-L-d9eyOE-b", + "TAB-l_9I0aNYZ", + "TABS-o2bzbhFhZA" + ], + "type": "TAB" + }, + "TABS-L-d9eyOE-b": { + "children": ["TAB-AsMaxdYL_t", "TAB-YT6eNksV-", "TAB-l_9I0aNYZ"], + "id": "TABS-L-d9eyOE-b", + "meta": {}, + "parents": ["ROOT_ID", "GRID_ID"], + "type": "TABS" + }, + "TABS-o2bzbhFhZA": { + "children": ["TAB-w0LzrqxZqF", "TAB-ZJBCsguEk"], + "id": "TABS-o2bzbhFhZA", + "meta": {}, + "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], + "type": "TABS" + } +} diff --git a/superset/config.py b/superset/config.py index 07b3bd73c7993..0859402ce4783 100644 --- a/superset/config.py +++ b/superset/config.py @@ -372,10 +372,10 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: # When True, this escapes HTML (rather than rendering it) in Markdown components "ESCAPE_MARKDOWN_HTML": False, "DASHBOARD_NATIVE_FILTERS": True, - "DASHBOARD_CROSS_FILTERS": False, + "DASHBOARD_CROSS_FILTERS": True, # Feature is under active development and breaking changes are expected - "DASHBOARD_NATIVE_FILTERS_SET": False, - "DASHBOARD_FILTERS_EXPERIMENTAL": False, + "DASHBOARD_NATIVE_FILTERS_SET": True, + "DASHBOARD_FILTERS_EXPERIMENTAL": True, "GLOBAL_ASYNC_QUERIES": False, "VERSIONED_EXPORT": False, # Note that: RowLevelSecurityFilter is only given by default to the Admin role @@ -387,7 +387,7 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: # tables that users do not have access to. "ROW_LEVEL_SECURITY": True, # Enables Alerts and reports new implementation - "ALERT_REPORTS": False, + "ALERT_REPORTS": True, # Enable experimental feature to search for other dashboards "OMNIBAR": False, "DASHBOARD_RBAC": False, diff --git a/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py b/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py new file mode 100644 index 0000000000000..cdbb74b7e90c8 --- /dev/null +++ b/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""add_selected_components_column_to_alerts + +Revision ID: 1b6c2615c693 +Revises: 0ca9e5f1dacd +Create Date: 2021-11-23 11:10:52.786279 + +""" + +# revision identifiers, used by Alembic. +revision = "1b6c2615c693" +down_revision = "0ca9e5f1dacd" + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column( + "alerts", + sa.Column( + "selected_components", + sa.Text(), + nullable=True, + ), + ) + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("alerts", "selected_components") + # ### end Alembic commands ### diff --git a/superset/models/alerts.py b/superset/models/alerts.py index 85bad4e16d74b..081b9a86e41cf 100644 --- a/superset/models/alerts.py +++ b/superset/models/alerts.py @@ -33,7 +33,7 @@ Text, ) from sqlalchemy.ext.declarative import declared_attr -from sqlalchemy.orm import backref, relationship, RelationshipProperty +from sqlalchemy.orm import backref, relationship, validates, RelationshipProperty from superset import db, security_manager from superset.models.helpers import AuditMixinNullable @@ -95,6 +95,20 @@ class Alert(Model, AuditMixinNullable): """ ), ) + selected_components = Column( + Text, + nullable=True, + ) + + @validates("selected_components") + def validate_selected_components(self, key, value): + if value is None: + return None + try: + json_value = json.loads(value) + except Exception as e: + raise + return json_value @declared_attr def database_id(self) -> int: @@ -126,7 +140,7 @@ def __str__(self) -> str: @property def pretty_config(self) -> str: - """ String representing the comparison that will trigger a validator """ + """String representing the comparison that will trigger a validator""" config = json.loads(self.validator_config) if self.validator_type.lower() == "operator": From 94e0b4cfc04c85a6a4f8fc81ed8c476750115282 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Tue, 23 Nov 2021 15:20:30 -0800 Subject: [PATCH 2/9] init --- .../1b6c2615c693_add_selected_components_column_to_alerts.py | 2 +- superset/models/alerts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py b/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py index cdbb74b7e90c8..a8c0ebb621d68 100644 --- a/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py +++ b/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py @@ -26,8 +26,8 @@ revision = "1b6c2615c693" down_revision = "0ca9e5f1dacd" -from alembic import op import sqlalchemy as sa +from alembic import op def upgrade(): diff --git a/superset/models/alerts.py b/superset/models/alerts.py index 081b9a86e41cf..68e4aa3746c7d 100644 --- a/superset/models/alerts.py +++ b/superset/models/alerts.py @@ -33,7 +33,7 @@ Text, ) from sqlalchemy.ext.declarative import declared_attr -from sqlalchemy.orm import backref, relationship, validates, RelationshipProperty +from sqlalchemy.orm import backref, relationship, RelationshipProperty, validates from superset import db, security_manager from superset.models.helpers import AuditMixinNullable From d972c19a0759bf0fbc845e620328a7e8d9633e42 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Tue, 30 Nov 2021 13:48:33 -0800 Subject: [PATCH 3/9] Modify migration --- ...9f68d6d_add_selected_components_column.py} | 21 ++++++++----------- superset/models/alerts.py | 16 +------------- superset/models/reports.py | 6 ++++++ 3 files changed, 16 insertions(+), 27 deletions(-) rename superset/migrations/versions/{1b6c2615c693_add_selected_components_column_to_alerts.py => e940f9f68d6d_add_selected_components_column.py} (78%) diff --git a/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py b/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py similarity index 78% rename from superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py rename to superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py index a8c0ebb621d68..12576eda5549f 100644 --- a/superset/migrations/versions/1b6c2615c693_add_selected_components_column_to_alerts.py +++ b/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py @@ -14,35 +14,32 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""add_selected_components_column_to_alerts +"""empty message -Revision ID: 1b6c2615c693 +Revision ID: e940f9f68d6d Revises: 0ca9e5f1dacd -Create Date: 2021-11-23 11:10:52.786279 +Create Date: 2021-11-30 13:40:25.544501 """ # revision identifiers, used by Alembic. -revision = "1b6c2615c693" +revision = "e940f9f68d6d" down_revision = "0ca9e5f1dacd" -import sqlalchemy as sa from alembic import op +import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( - "alerts", - sa.Column( - "selected_components", - sa.Text(), - nullable=True, - ), + "report_schedule", sa.Column("selected_components", sa.Text(), nullable=True) ) + # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.drop_column("alerts", "selected_components") + op.drop_column("report_schedule", "selected_components") + # ### end Alembic commands ### diff --git a/superset/models/alerts.py b/superset/models/alerts.py index 68e4aa3746c7d..163dcf027de0e 100644 --- a/superset/models/alerts.py +++ b/superset/models/alerts.py @@ -33,7 +33,7 @@ Text, ) from sqlalchemy.ext.declarative import declared_attr -from sqlalchemy.orm import backref, relationship, RelationshipProperty, validates +from sqlalchemy.orm import backref, relationship, RelationshipProperty from superset import db, security_manager from superset.models.helpers import AuditMixinNullable @@ -95,20 +95,6 @@ class Alert(Model, AuditMixinNullable): """ ), ) - selected_components = Column( - Text, - nullable=True, - ) - - @validates("selected_components") - def validate_selected_components(self, key, value): - if value is None: - return None - try: - json_value = json.loads(value) - except Exception as e: - raise - return json_value @declared_attr def database_id(self) -> int: diff --git a/superset/models/reports.py b/superset/models/reports.py index 6ed769dd49400..5aeb6b17155fc 100644 --- a/superset/models/reports.py +++ b/superset/models/reports.py @@ -145,6 +145,12 @@ class ReportSchedule(Model, AuditMixinNullable): # (Alerts/Reports) Unlock a possible stalled working state working_timeout = Column(Integer, default=60 * 60 * 1) + # Store the selected dashboard tabs + selected_components = Column( + Text, + nullable=True, + ) + def __repr__(self) -> str: return str(self.name) From b4c368365552831e1f172196b53c8001a5acf72b Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Tue, 30 Nov 2021 13:48:53 -0800 Subject: [PATCH 4/9] Modify migration --- .../versions/e940f9f68d6d_add_selected_components_column.py | 2 +- superset/models/reports.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py b/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py index 12576eda5549f..563fcb0bf1b96 100644 --- a/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py +++ b/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py @@ -26,8 +26,8 @@ revision = "e940f9f68d6d" down_revision = "0ca9e5f1dacd" -from alembic import op import sqlalchemy as sa +from alembic import op def upgrade(): diff --git a/superset/models/reports.py b/superset/models/reports.py index 5aeb6b17155fc..ecde434153503 100644 --- a/superset/models/reports.py +++ b/superset/models/reports.py @@ -146,10 +146,7 @@ class ReportSchedule(Model, AuditMixinNullable): working_timeout = Column(Integer, default=60 * 60 * 1) # Store the selected dashboard tabs - selected_components = Column( - Text, - nullable=True, - ) + selected_components = Column(Text, nullable=True,) def __repr__(self) -> str: return str(self.name) From 26e12aa81414d2afb5759c1d77e4cf68f581a3cc Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Tue, 30 Nov 2021 13:56:28 -0800 Subject: [PATCH 5/9] revert config, delete test file --- superset-frontend/test.json | 683 ------------------------------------ superset/config.py | 9 +- 2 files changed, 5 insertions(+), 687 deletions(-) delete mode 100644 superset-frontend/test.json diff --git a/superset-frontend/test.json b/superset-frontend/test.json deleted file mode 100644 index 72d16b749d2c2..0000000000000 --- a/superset-frontend/test.json +++ /dev/null @@ -1,683 +0,0 @@ -{ - "CHART--0GPGmD-pO": { - "children": [], - "id": "CHART--0GPGmD-pO", - "meta": { - "chartId": 119, - "height": 48, - "sliceName": "Current Developers: Is this your first development job?", - "sliceNameOverride": "Is this your first development job?", - "uuid": "bfe5a8e6-146f-ef59-5e6c-13d519b236a8", - "width": 2 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-b7USYEngT" - ], - "type": "CHART" - }, - "CHART--w_Br1tPP3": { - "children": [], - "id": "CHART--w_Br1tPP3", - "meta": { - "chartId": 97, - "height": 51, - "sliceName": "\u2708\ufe0f Relocation ability", - "uuid": "a6dd2d5a-2cdc-c8ec-f30c-85920f4f8a65", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW-DR80aHJA2c" - ], - "type": "CHART" - }, - "CHART-0-zzTwBINh": { - "children": [], - "id": "CHART-0-zzTwBINh", - "meta": { - "chartId": 90, - "height": 49, - "sliceName": "Last Year Income Distribution", - "uuid": "a2ec5256-94b4-43c4-b8c7-b83f70c5d4df", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-b7USYEngT" - ], - "type": "CHART" - }, - "CHART-37fu7fO6Z0": { - "children": [], - "id": "CHART-37fu7fO6Z0", - "meta": { - "chartId": 128, - "height": 69, - "sliceName": "Degrees vs Income", - "uuid": "02f546ae-1bf4-bd26-8bc2-14b9279c8a62", - "width": 7 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-kNjtGVFpp" - ], - "type": "CHART" - }, - "CHART-5QwNlSbXYU": { - "children": [], - "id": "CHART-5QwNlSbXYU", - "meta": { - "chartId": 94, - "height": 69, - "sliceName": "Commute Time", - "uuid": "097c05c9-2dd2-481d-813d-d6c0c12b4a3d", - "width": 5 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-kNjtGVFpp" - ], - "type": "CHART" - }, - "CHART-FKuVqq4kaA": { - "children": [], - "id": "CHART-FKuVqq4kaA", - "meta": { - "chartId": 139, - "height": 50, - "sliceName": "Work Location Preference", - "sliceNameOverride": "Work Location Preference", - "uuid": "e6b09c28-98cf-785f-4caf-320fd4fca802", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW-DR80aHJA2c" - ], - "type": "CHART" - }, - "CHART-JnpdZOhVer": { - "children": [], - "id": "CHART-JnpdZOhVer", - "meta": { - "chartId": 95, - "height": 50, - "sliceName": "Highest degree held", - "uuid": "9f7d2b9c-6b3a-69f9-f03e-d3a141514639", - "width": 2 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW--BIzjz9F0", - "COLUMN-IEKAo_QJlz" - ], - "type": "CHART" - }, - "CHART-LjfhrUkEef": { - "children": [], - "id": "CHART-LjfhrUkEef", - "meta": { - "chartId": 87, - "height": 68, - "sliceName": "First Time Developer & Commute Time", - "uuid": "067c4a1e-ae03-4c0c-8e2a-d2c0f4bf43c3", - "width": 5 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-s3l4os7YY" - ], - "type": "CHART" - }, - "CHART-Q3pbwsH3id": { - "children": [], - "id": "CHART-Q3pbwsH3id", - "meta": { - "chartId": 85, - "height": 50, - "sliceName": "Are you an ethnic minority in your city?", - "sliceNameOverride": "Minority Status (in their city)", - "uuid": "def07750-b5c0-0b69-6228-cb2330916166", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-mOvr_xWm1" - ], - "type": "CHART" - }, - "CHART-QVql08s5Bv": { - "children": [], - "id": "CHART-QVql08s5Bv", - "meta": { - "chartId": 100, - "height": 50, - "sliceName": "First Time Developer?", - "uuid": "edc75073-8f33-4123-a28d-cd6dfb33cade", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-b7USYEngT" - ], - "type": "CHART" - }, - "CHART-UtSaz4pfV6": { - "children": [], - "id": "CHART-UtSaz4pfV6", - "meta": { - "chartId": 106, - "height": 50, - "sliceName": "Age distribution of respondents", - "uuid": "5f1ea868-604e-f69d-a241-5daa83ff33be", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-UsW-_RPAb", - "COLUMN-OJ5spdMmNh" - ], - "type": "CHART" - }, - "CHART-VvFbGxi3X_": { - "children": [], - "id": "CHART-VvFbGxi3X_", - "meta": { - "chartId": 117, - "height": 62, - "sliceName": "Top 15 Languages Spoken at Home", - "uuid": "03a74c97-52fc-cf87-233c-d4275f8c550c", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-UsW-_RPAb", - "COLUMN-OJ5spdMmNh" - ], - "type": "CHART" - }, - "CHART-XHncHuS5pZ": { - "children": [], - "id": "CHART-XHncHuS5pZ", - "meta": { - "chartId": 132, - "height": 41, - "sliceName": "Number of Aspiring Developers", - "sliceNameOverride": "What type of work would you prefer?", - "uuid": "a0e5329f-224e-6fc8-efd2-d37d0f546ee8", - "width": 2 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW-DR80aHJA2c" - ], - "type": "CHART" - }, - "CHART-YSzS5GOOLf": { - "children": [], - "id": "CHART-YSzS5GOOLf", - "meta": { - "chartId": 131, - "height": 54, - "sliceName": "Ethnic Minority & Gender", - "uuid": "4880e4f4-b701-4be0-86f3-e7e89432e83b", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-mOvr_xWm1" - ], - "type": "CHART" - }, - "CHART-ZECnzPz8Bi": { - "children": [], - "id": "CHART-ZECnzPz8Bi", - "meta": { - "chartId": 101, - "height": 74, - "sliceName": "Location of Current Developers", - "uuid": "5596e0f6-78a9-465d-8325-7139c794a06a", - "width": 7 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-s3l4os7YY" - ], - "type": "CHART" - }, - "CHART-aytwlT4GAq": { - "children": [], - "id": "CHART-aytwlT4GAq", - "meta": { - "chartId": 118, - "height": 50, - "sliceName": "Breakdown of Developer Type", - "uuid": "b8386be8-f44e-6535-378c-2aa2ba461286", - "width": 4 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-y-GwJPgxLr" - ], - "type": "CHART" - }, - "CHART-d6vjW6rC6V": { - "children": [], - "id": "CHART-d6vjW6rC6V", - "meta": { - "chartId": 112, - "height": 54, - "sliceName": "Filter Segments", - "sliceNameOverride": "Filter By", - "uuid": "6420629a-ce74-2c6b-ef7d-b2e78baa3cfe", - "width": 5 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-y-GwJPgxLr" - ], - "type": "CHART" - }, - "CHART-fLpTSAHpAO": { - "children": [], - "id": "CHART-fLpTSAHpAO", - "meta": { - "chartId": 134, - "height": 118, - "sliceName": "Country of Citizenship", - "uuid": "2ba66056-a756-d6a3-aaec-0c243fb7062e", - "width": 9 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-UsW-_RPAb" - ], - "type": "CHART" - }, - "CHART-lQVSAw0Or3": { - "children": [], - "id": "CHART-lQVSAw0Or3", - "meta": { - "chartId": 120, - "height": 100, - "sliceName": "How do you prefer to work?", - "sliceNameOverride": "Preferred Employment Style vs Degree", - "uuid": "cb8998ab-9f93-4f0f-4e4b-3bfe4b0dea9d", - "width": 4 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW--BIzjz9F0" - ], - "type": "CHART" - }, - "CHART-o-JPAWMZK-": { - "children": [], - "id": "CHART-o-JPAWMZK-", - "meta": { - "chartId": 136, - "height": 50, - "sliceName": "Gender", - "uuid": "0f6b447c-828c-e71c-87ac-211bc412b214", - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-mOvr_xWm1" - ], - "type": "CHART" - }, - "CHART-v22McUFMtx": { - "children": [], - "id": "CHART-v22McUFMtx", - "meta": { - "chartId": 96, - "height": 52, - "sliceName": "How much do you expect to earn? ($0 - 100k)", - "sliceNameOverride": "\ud83d\udcb2Expected Income (excluding outliers)", - "uuid": "6d0ceb30-2008-d19c-d285-cf77dc764433", - "width": 4 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW--BIzjz9F0", - "COLUMN-IEKAo_QJlz" - ], - "type": "CHART" - }, - "CHART-wxWVtlajRF": { - "children": [], - "id": "CHART-wxWVtlajRF", - "meta": { - "chartId": 81, - "height": 104, - "sliceName": "Preferred Employment Style", - "uuid": "bff88053-ccc4-92f2-d6f5-de83e950e8cd", - "width": 4 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW--BIzjz9F0" - ], - "type": "CHART" - }, - "COLUMN-IEKAo_QJlz": { - "children": ["CHART-JnpdZOhVer", "CHART-v22McUFMtx"], - "id": "COLUMN-IEKAo_QJlz", - "meta": { "background": "BACKGROUND_TRANSPARENT", "width": 4 }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW--BIzjz9F0" - ], - "type": "COLUMN" - }, - "COLUMN-OJ5spdMmNh": { - "children": ["CHART-VvFbGxi3X_", "CHART-UtSaz4pfV6"], - "id": "COLUMN-OJ5spdMmNh", - "meta": { "background": "BACKGROUND_TRANSPARENT", "width": 3 }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-UsW-_RPAb" - ], - "type": "COLUMN" - }, - "DASHBOARD_VERSION_KEY": "v2", - "GRID_ID": { - "children": ["TABS-L-d9eyOE-b"], - "id": "GRID_ID", - "parents": ["ROOT_ID"], - "type": "GRID" - }, - "HEADER_ID": { - "id": "HEADER_ID", - "meta": { "text": "FCC New Coder Survey 2018" }, - "type": "HEADER" - }, - "MARKDOWN-BUmyHM2s0x": { - "children": [], - "id": "MARKDOWN-BUmyHM2s0x", - "meta": { - "code": "# Aspiring Developers\n\nThe mission of FreeCodeCamp is to \"help people learn to code for free\". With this in mind, it's no surprise that ~83% of this survey's respondents fall into the **Aspiring Developer** category.\n\nIn this tab, we use visualization to explore:\n\n- Interest in relocating for work\n- Preferences around work location & style\n- Distribution of expected income\n- Distribution of highest degree held\n- Heatmap of highest degree held vs employment style preference", - "height": 50, - "width": 4 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-YT6eNksV-", - "ROW-DR80aHJA2c" - ], - "type": "MARKDOWN" - }, - "MARKDOWN-NQmSPDOtpl": { - "children": [], - "id": "MARKDOWN-NQmSPDOtpl", - "meta": { - "code": "# Current Developers\n\nWhile majority of the students on FCC are Aspiring developers, there's a nontrivial minority that's there to continue leveling up their skills (17% of the survey respondents).\n\nBased on how respondents self-identified in the start of the survey, they were asked different questions. In this tab, we use visualizations to explore:\n\n- The buckets of commute team these developers encounter\n- The proportion of developers whose current job is their first developer job\n- Distribution of last year's income\n- The geographic distribution of these developers\n- The overlap between commute time and if their current job is their first developer job\n- Potential link between highest degree earned and last year's income", - "height": 50, - "width": 4 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "ROW-b7USYEngT" - ], - "type": "MARKDOWN" - }, - "MARKDOWN-__u6CsUyfh": { - "children": [], - "id": "MARKDOWN-__u6CsUyfh", - "meta": { - "code": "## FreeCodeCamp New Coder Survey 2018\n\nEvery year, FCC surveys its user base (mostly budding softwware developers) to learn more about their interests, backgrounds, goals, job status, and socioeconomic features. This dashboard visualizes survey data from the 2018 survey.\n\n- [Survey link](https://freecodecamp.typeform.com/to/S3UeD9)\n- [Dataset](https://github.com/freeCodeCamp/2018-new-coder-survey)\n- [FCC Blog Post](https://www.freecodecamp.org/news/we-asked-20-000-people-who-they-are-and-how-theyre-learning-to-code-fff5d668969/)", - "height": 45, - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-y-GwJPgxLr" - ], - "type": "MARKDOWN" - }, - "MARKDOWN-zc2mWxZeox": { - "children": [], - "id": "MARKDOWN-zc2mWxZeox", - "meta": { - "code": "# Demographics\n\nFreeCodeCamp is a completely-online community of people learning to code and consists of aspiring & current developers from all over the world. That doesn't necessarily mean that acccess to these types of opportunities are evenly distributed. \n\nThe following charts can begin to help us understand:\n\n- the original citizenship of the survey respondents\n- minority representation among both aspiring and current developers\n- their age distribution\n- household languages", - "height": 52, - "width": 3 - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-AsMaxdYL_t", - "ROW-mOvr_xWm1" - ], - "type": "MARKDOWN" - }, - "ROOT_ID": { "children": ["GRID_ID"], "id": "ROOT_ID", "type": "ROOT" }, - "ROW--BIzjz9F0": { - "children": ["COLUMN-IEKAo_QJlz", "CHART-lQVSAw0Or3", "CHART-wxWVtlajRF"], - "id": "ROW--BIzjz9F0", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-YT6eNksV-"], - "type": "ROW" - }, - "ROW-DR80aHJA2c": { - "children": [ - "MARKDOWN-BUmyHM2s0x", - "CHART-XHncHuS5pZ", - "CHART--w_Br1tPP3", - "CHART-FKuVqq4kaA" - ], - "id": "ROW-DR80aHJA2c", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-YT6eNksV-"], - "type": "ROW" - }, - "ROW-UsW-_RPAb": { - "children": ["COLUMN-OJ5spdMmNh", "CHART-fLpTSAHpAO"], - "id": "ROW-UsW-_RPAb", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-AsMaxdYL_t"], - "type": "ROW" - }, - "ROW-b7USYEngT": { - "children": [ - "MARKDOWN-NQmSPDOtpl", - "CHART--0GPGmD-pO", - "CHART-QVql08s5Bv", - "CHART-0-zzTwBINh" - ], - "id": "ROW-b7USYEngT", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], - "type": "ROW" - }, - "ROW-kNjtGVFpp": { - "children": ["CHART-5QwNlSbXYU", "CHART-37fu7fO6Z0"], - "id": "ROW-kNjtGVFpp", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], - "type": "ROW" - }, - "ROW-mOvr_xWm1": { - "children": [ - "MARKDOWN-zc2mWxZeox", - "CHART-Q3pbwsH3id", - "CHART-o-JPAWMZK-", - "CHART-YSzS5GOOLf" - ], - "id": "ROW-mOvr_xWm1", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-AsMaxdYL_t"], - "type": "ROW" - }, - "ROW-s3l4os7YY": { - "children": ["CHART-LjfhrUkEef", "CHART-ZECnzPz8Bi"], - "id": "ROW-s3l4os7YY", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], - "type": "ROW" - }, - "ROW-y-GwJPgxLr": { - "children": ["MARKDOWN-__u6CsUyfh", "CHART-aytwlT4GAq", "CHART-d6vjW6rC6V"], - "id": "ROW-y-GwJPgxLr", - "meta": { "background": "BACKGROUND_TRANSPARENT" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-AsMaxdYL_t"], - "type": "ROW" - }, - "TAB-AsMaxdYL_t": { - "children": ["ROW-y-GwJPgxLr", "ROW-mOvr_xWm1", "ROW-UsW-_RPAb"], - "id": "TAB-AsMaxdYL_t", - "meta": { "text": "Overview" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b"], - "type": "TAB" - }, - "TAB-YT6eNksV-": { - "children": ["ROW-DR80aHJA2c", "ROW--BIzjz9F0"], - "id": "TAB-YT6eNksV-", - "meta": { "text": "\ud83d\ude80 Aspiring Developers" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b"], - "type": "TAB" - }, - "TAB-ZJBCsguEk": { - "children": [], - "id": "TAB-ZJBCsguEk", - "meta": { - "defaultText": "Tab title", - "placeholder": "Tab title", - "text": "Drill down" - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "TABS-o2bzbhFhZA" - ], - "type": "TAB" - }, - "TAB-l_9I0aNYZ": { - "children": [ - "TABS-o2bzbhFhZA", - "ROW-b7USYEngT", - "ROW-kNjtGVFpp", - "ROW-s3l4os7YY" - ], - "id": "TAB-l_9I0aNYZ", - "meta": { "text": "\ud83d\udcbb Current Developers" }, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b"], - "type": "TAB" - }, - "TAB-w0LzrqxZqF": { - "children": [], - "id": "TAB-w0LzrqxZqF", - "meta": { - "defaultText": "Tab title", - "placeholder": "Tab title", - "text": "Overview" - }, - "parents": [ - "ROOT_ID", - "GRID_ID", - "TABS-L-d9eyOE-b", - "TAB-l_9I0aNYZ", - "TABS-o2bzbhFhZA" - ], - "type": "TAB" - }, - "TABS-L-d9eyOE-b": { - "children": ["TAB-AsMaxdYL_t", "TAB-YT6eNksV-", "TAB-l_9I0aNYZ"], - "id": "TABS-L-d9eyOE-b", - "meta": {}, - "parents": ["ROOT_ID", "GRID_ID"], - "type": "TABS" - }, - "TABS-o2bzbhFhZA": { - "children": ["TAB-w0LzrqxZqF", "TAB-ZJBCsguEk"], - "id": "TABS-o2bzbhFhZA", - "meta": {}, - "parents": ["ROOT_ID", "GRID_ID", "TABS-L-d9eyOE-b", "TAB-l_9I0aNYZ"], - "type": "TABS" - } -} diff --git a/superset/config.py b/superset/config.py index 0859402ce4783..2d7e7dbb46965 100644 --- a/superset/config.py +++ b/superset/config.py @@ -314,6 +314,7 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: "pt_BR": {"flag": "br", "name": "Brazilian Portuguese"}, "ru": {"flag": "ru", "name": "Russian"}, "ko": {"flag": "kr", "name": "Korean"}, + "sk": {"flag": "sk", "name": "Slovak"}, "sl": {"flag": "si", "name": "Slovenian"}, } # Turning off i18n by default as translation in most languages are @@ -372,10 +373,10 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: # When True, this escapes HTML (rather than rendering it) in Markdown components "ESCAPE_MARKDOWN_HTML": False, "DASHBOARD_NATIVE_FILTERS": True, - "DASHBOARD_CROSS_FILTERS": True, + "DASHBOARD_CROSS_FILTERS": False, # Feature is under active development and breaking changes are expected - "DASHBOARD_NATIVE_FILTERS_SET": True, - "DASHBOARD_FILTERS_EXPERIMENTAL": True, + "DASHBOARD_NATIVE_FILTERS_SET": False, + "DASHBOARD_FILTERS_EXPERIMENTAL": False, "GLOBAL_ASYNC_QUERIES": False, "VERSIONED_EXPORT": False, # Note that: RowLevelSecurityFilter is only given by default to the Admin role @@ -387,7 +388,7 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: # tables that users do not have access to. "ROW_LEVEL_SECURITY": True, # Enables Alerts and reports new implementation - "ALERT_REPORTS": True, + "ALERT_REPORTS": False, # Enable experimental feature to search for other dashboards "OMNIBAR": False, "DASHBOARD_RBAC": False, From 8562707ab02bb5617dbcafcf15dd240fb42b3c93 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Thu, 2 Dec 2021 09:14:15 -0800 Subject: [PATCH 6/9] Rename column, modify migration --- ...1892_add_extra_config_column_to_alerts.py} | 22 ++++++++----------- superset/models/reports.py | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) rename superset/migrations/versions/{e940f9f68d6d_add_selected_components_column.py => f1b7603e1892_add_extra_config_column_to_alerts.py} (64%) diff --git a/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py b/superset/migrations/versions/f1b7603e1892_add_extra_config_column_to_alerts.py similarity index 64% rename from superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py rename to superset/migrations/versions/f1b7603e1892_add_extra_config_column_to_alerts.py index 563fcb0bf1b96..092b2eca2d1cf 100644 --- a/superset/migrations/versions/e940f9f68d6d_add_selected_components_column.py +++ b/superset/migrations/versions/f1b7603e1892_add_extra_config_column_to_alerts.py @@ -14,32 +14,28 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""empty message +"""add_extra_config_column_to_alerts -Revision ID: e940f9f68d6d -Revises: 0ca9e5f1dacd -Create Date: 2021-11-30 13:40:25.544501 +Revision ID: f1b7603e1892 +Revises: aea15018d53b +Create Date: 2021-12-02 09:03:11.627444 """ # revision identifiers, used by Alembic. -revision = "e940f9f68d6d" -down_revision = "0ca9e5f1dacd" +revision = "f1b7603e1892" +down_revision = "aea15018d53b" import sqlalchemy as sa from alembic import op def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### op.add_column( - "report_schedule", sa.Column("selected_components", sa.Text(), nullable=True) + "report_schedule", + sa.Column("extra_config", sa.Text(), nullable=False, server_default="{}"), ) - # ### end Alembic commands ### def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column("report_schedule", "selected_components") - - # ### end Alembic commands ### + op.drop_column("report_schedule", "extra_config") diff --git a/superset/models/reports.py b/superset/models/reports.py index ecde434153503..a647aab2b8c83 100644 --- a/superset/models/reports.py +++ b/superset/models/reports.py @@ -146,7 +146,7 @@ class ReportSchedule(Model, AuditMixinNullable): working_timeout = Column(Integer, default=60 * 60 * 1) # Store the selected dashboard tabs - selected_components = Column(Text, nullable=True,) + extra_config = Column(Text, nullable=False, default="{}") def __repr__(self) -> str: return str(self.name) From 2098786884f62a9bfa4b7fae7183566e67e198d8 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Thu, 2 Dec 2021 12:11:01 -0800 Subject: [PATCH 7/9] rename a column --- ...93db_add_extra_config_column_to_alerts.py} | 23 +++++++++++++++---- superset/models/reports.py | 4 ++-- 2 files changed, 20 insertions(+), 7 deletions(-) rename superset/migrations/versions/{f1b7603e1892_add_extra_config_column_to_alerts.py => abe27eaf93db_add_extra_config_column_to_alerts.py} (67%) diff --git a/superset/migrations/versions/f1b7603e1892_add_extra_config_column_to_alerts.py b/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py similarity index 67% rename from superset/migrations/versions/f1b7603e1892_add_extra_config_column_to_alerts.py rename to superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py index 092b2eca2d1cf..672e805fe3512 100644 --- a/superset/migrations/versions/f1b7603e1892_add_extra_config_column_to_alerts.py +++ b/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py @@ -16,26 +16,39 @@ # under the License. """add_extra_config_column_to_alerts -Revision ID: f1b7603e1892 +Revision ID: abe27eaf93db Revises: aea15018d53b -Create Date: 2021-12-02 09:03:11.627444 +Create Date: 2021-12-02 12:03:20.691171 """ # revision identifiers, used by Alembic. -revision = "f1b7603e1892" +revision = "abe27eaf93db" down_revision = "aea15018d53b" import sqlalchemy as sa +from sqlalchemy.sql import table, column +from sqlalchemy import String + from alembic import op +connection = op.get_bind() + +report_schedule = table("report_schedule", column("extra", String)) + def upgrade(): op.add_column( "report_schedule", - sa.Column("extra_config", sa.Text(), nullable=False, server_default="{}"), + sa.Column( + "extra", + sa.Text(), + nullable=True, + default="{}", + ), ) + connection.execute(report_schedule.update().values({"extra": "{}"})) def downgrade(): - op.drop_column("report_schedule", "extra_config") + op.drop_column("report_schedule", "extra") diff --git a/superset/models/reports.py b/superset/models/reports.py index a647aab2b8c83..a0dc59917a42c 100644 --- a/superset/models/reports.py +++ b/superset/models/reports.py @@ -145,8 +145,8 @@ class ReportSchedule(Model, AuditMixinNullable): # (Alerts/Reports) Unlock a possible stalled working state working_timeout = Column(Integer, default=60 * 60 * 1) - # Store the selected dashboard tabs - extra_config = Column(Text, nullable=False, default="{}") + # Store the selected dashboard tabs etc. + extra = Column(Text, default="{}") def __repr__(self) -> str: return str(self.name) From ddac85cccd715dcdc1bb7e90b70531cce9465190 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Thu, 2 Dec 2021 12:39:48 -0800 Subject: [PATCH 8/9] Make extra non-nullable --- ...f93db_add_extra_config_column_to_alerts.py | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py b/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py index 672e805fe3512..8052b85469646 100644 --- a/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py +++ b/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py @@ -27,10 +27,9 @@ down_revision = "aea15018d53b" import sqlalchemy as sa -from sqlalchemy.sql import table, column -from sqlalchemy import String - from alembic import op +from sqlalchemy import String +from sqlalchemy.sql import column, table connection = op.get_bind() @@ -38,16 +37,13 @@ def upgrade(): - op.add_column( - "report_schedule", - sa.Column( - "extra", - sa.Text(), - nullable=True, - default="{}", - ), - ) - connection.execute(report_schedule.update().values({"extra": "{}"})) + with op.batch_alter_table("report_schedule") as batch_op: + op.add_column( + "report_schedule", + sa.Column("extra", sa.Text(), nullable=True, default="{}",), + ) + connection.execute(report_schedule.update().values({"extra": "{}"})) + batch_op.alter_column("extra", existing_type=sa.Text(), nullabe=False) def downgrade(): From b45db180d6174558fcf51a552a638b26785f97a6 Mon Sep 17 00:00:00 2001 From: Ajay Mancheery Date: Thu, 2 Dec 2021 12:57:55 -0800 Subject: [PATCH 9/9] Fix typo --- .../abe27eaf93db_add_extra_config_column_to_alerts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py b/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py index 8052b85469646..c0cce0ac9e650 100644 --- a/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py +++ b/superset/migrations/versions/abe27eaf93db_add_extra_config_column_to_alerts.py @@ -38,12 +38,12 @@ def upgrade(): with op.batch_alter_table("report_schedule") as batch_op: - op.add_column( - "report_schedule", + batch_op.add_column( sa.Column("extra", sa.Text(), nullable=True, default="{}",), ) - connection.execute(report_schedule.update().values({"extra": "{}"})) - batch_op.alter_column("extra", existing_type=sa.Text(), nullabe=False) + connection.execute(report_schedule.update().values({"extra": "{}"})) + with op.batch_alter_table("report_schedule") as batch_op: + batch_op.alter_column("extra", existing_type=sa.Text(), nullable=False) def downgrade():