Skip to content

Commit

Permalink
Merge branch 'master' into fix-order-by
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ committed Dec 17, 2021
2 parents 7a0e74d + 4beaa81 commit 4152dd4
Show file tree
Hide file tree
Showing 163 changed files with 2,281 additions and 916 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ coverage:
target: auto
threshold: 0%
core-packages-ts:
target: 95%
target: 100%
paths:
- 'superset-frontend/packages'
- '!superset-frontend/packages/**/*.jsx'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-python-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Python unit tests
if: steps.check.outcome == 'failure'
run: |
pytest ./tests/unit_tests --cache-clear
pytest --durations=0 ./tests/unit_tests --cache-clear
- name: Upload code coverage
if: steps.check.outcome == 'failure'
run: |
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ The dev server by default starts at `http://localhost:9000` and proxies the back
npm run dev-server

# Run the dev server on a non-default port
npm run dev-server -- --devserverPort=9001
npm run dev-server -- --port=9001

# Proxy backend requests to a Flask server running on a non-default port
npm run dev-server -- --supersetPort=8081
Expand Down Expand Up @@ -964,7 +964,7 @@ You are now ready to attach a debugger to the process. Using VSCode you can conf
}
```
VSCode will not stop on breakpoints right away. We've attached to PID 6 however it does not yet know of any sub-processes. In order to "wakeup" the debugger you need to modify a python file. This will trigger Flask to reload the code and create a new sub-process. This new sub-process will be detected by VSCode and breakpoints will be activated.
VSCode will not stop on breakpoints right away. We've attached to PID 6 however it does not yet know of any sub-processes. In order to "wake up" the debugger you need to modify a python file. This will trigger Flask to reload the code and create a new sub-process. This new sub-process will be detected by VSCode and breakpoints will be activated.
### Debugging Server App in Kubernetes Environment
Expand Down Expand Up @@ -1339,16 +1339,16 @@ More information on the async query feature can be found in [SIP-39](https://git
Chart parameters are stored as a JSON encoded string the `slices.params` column and are often referenced throughout the code as form-data. Currently the form-data is neither versioned nor typed as thus is somewhat free-formed. Note in the future there may be merit in using something like [JSON Schema](https://json-schema.org/) to both annotate and validate the JSON object in addition to using a Mypy `TypedDict` (introduced in Python 3.8) for typing the form-data in the backend. This section serves as a potential primer for that work.
The following tables provide a non-exhausive list of the various fields which can be present in the JSON object grouped by the Explorer pane sections. These values were obtained by extracting the distinct fields from a legacy deployment consisting of tens of thousands of charts and thus some fields may be missing whilst others may be deprecated.
The following tables provide a non-exhaustive list of the various fields which can be present in the JSON object grouped by the Explorer pane sections. These values were obtained by extracting the distinct fields from a legacy deployment consisting of tens of thousands of charts and thus some fields may be missing whilst others may be deprecated.
Note not all fields are correctly categorized. The fields vary based on visualization type and may apprear in different sections depending on the type. Verified deprecated columns may indicate a missing migration and/or prior migrations which were unsuccessful and thus future work may be required to clean up the form-data.
Note not all fields are correctly categorized. The fields vary based on visualization type and may appear in different sections depending on the type. Verified deprecated columns may indicate a missing migration and/or prior migrations which were unsuccessful and thus future work may be required to clean up the form-data.
### Datasource & Chart Type
| Field | Type | Notes |
| ----------------- | -------- | ----------------------------------- |
| `database_name` | _string_ | _Deprecated?_ |
| `datasource` | _string_ | `<datasouce_id>__<datasource_type>` |
| `datasource` | _string_ | `<datasource_id>__<datasource_type>` |
| `datasource_id` | _string_ | _Deprecated?_ See `datasource` |
| `datasource_name` | _string_ | _Deprecated?_ |
| `datasource_type` | _string_ | _Deprecated?_ See `datasource` |
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ superset:
# Load some data to play with
superset load-examples

# Install node packages
cd superset-frontend; npm install

update: update-py update-js

update-py:
Expand Down
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ assists people when migrating to a new version.
- [17539](https://github.com/apache/superset/pull/17539): all Superset CLI commands
(init, load_examples and etc) require setting the FLASK_APP environment variable
(which is set by default when .flaskenv is loaded)
- [17360](https://github.com/apache/superset/pull/17360): changes the column type from `VARCHAR(32)` to `TEXT` in table `table_columns`, potentially requiring a table lock on MySQL dbs or taking some time to complete on large deployments.

### Deprecations

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ flask==1.1.4
# flask-openid
# flask-sqlalchemy
# flask-wtf
flask-appbuilder==3.4.1rc2
flask-appbuilder==3.4.1
# via apache-superset
flask-babel==1.0.0
# via flask-appbuilder
Expand Down
2 changes: 1 addition & 1 deletion scripts/python_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ superset db upgrade
superset init

echo "Running tests"
pytest --maxfail=1 --cov=superset $@
pytest --durations=0 --maxfail=1 --cov=superset $@
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_git_sha() -> str:
"cryptography>=3.3.2",
"deprecation>=2.1.0, <2.2.0",
"flask>=1.1.0, <2.0.0",
"flask-appbuilder>=3.4.1rc2, <4.0.0",
"flask-appbuilder>=3.4.1, <4.0.0",
"flask-caching>=1.10.0",
"flask-compress",
"flask-talisman",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { interceptChart } from 'cypress/utils';

describe('Visualization > Big Number with Trendline', () => {
const BIG_NUMBER_FORM_DATA = {
datasource: '2__table',
Expand All @@ -42,21 +44,21 @@ describe('Visualization > Big Number with Trendline', () => {
function verify(formData) {
cy.visitChartByParams(JSON.stringify(formData));
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@chartData',
chartSelector: '.superset-legacy-chart-big-number',
});
}

beforeEach(() => {
cy.login();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
interceptChart({ legacy: false }).as('chartData');
});

it('should work', () => {
verify(BIG_NUMBER_FORM_DATA);
cy.get('.chart-container .header-line');
cy.get('.chart-container .subheader-line');
cy.get('.chart-container svg path.vx-linepath');
cy.get('.chart-container canvas');
});

it('should work without subheader', () => {
Expand All @@ -66,7 +68,7 @@ describe('Visualization > Big Number with Trendline', () => {
});
cy.get('.chart-container .header-line');
cy.get('.chart-container .subheader-line').should('not.exist');
cy.get('.chart-container svg path.vx-linepath');
cy.get('.chart-container canvas');
});

it('should not render trendline when hidden', () => {
Expand All @@ -76,6 +78,6 @@ describe('Visualization > Big Number with Trendline', () => {
});
cy.get('[data-test="chart-container"] .header-line');
cy.get('[data-test="chart-container"] .subheader-line');
cy.get('[data-test="chart-container"] svg').should('not.exist');
cy.get('[data-test="chart-container"] canvas').should('not.exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { interceptChart } from 'cypress/utils';
import { FORM_DATA_DEFAULTS, NUM_METRIC } from './shared.helper';

describe('Visualization > Big Number Total', () => {
Expand All @@ -26,15 +27,15 @@ describe('Visualization > Big Number Total', () => {

beforeEach(() => {
cy.login();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
interceptChart({ legacy: false }).as('chartData');
});

it('Test big number chart with adhoc metric', () => {
const formData = { ...BIG_NUMBER_DEFAULTS, metric: NUM_METRIC };

cy.visitChartByParams(JSON.stringify(formData));
cy.visitChartByParams(formData);
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@chartData',
querySubstring: NUM_METRIC.label,
});
});
Expand All @@ -58,8 +59,8 @@ describe('Visualization > Big Number Total', () => {
adhoc_filters: filters,
};

cy.visitChartByParams(JSON.stringify(formData));
cy.verifySliceSuccess({ waitAlias: '@getJson' });
cy.visitChartByParams(formData);
cy.verifySliceSuccess({ waitAlias: '@chartData' });
});

it('Test big number chart ignores groupby', () => {
Expand All @@ -69,11 +70,11 @@ describe('Visualization > Big Number Total', () => {
groupby: ['state'],
};

cy.visitChartByParams(JSON.stringify(formData));
cy.wait(['@getJson']).then(async ({ response }) => {
cy.visitChartByParams(formData);
cy.wait(['@chartData']).then(async ({ response }) => {
cy.verifySliceContainer();
const responseBody = response?.body;
expect(responseBody.query).not.contains(formData.groupby[0]);
expect(responseBody.result[0].query).not.contains(formData.groupby[0]);
});
});
});
2 changes: 2 additions & 0 deletions superset-frontend/cypress-base/cypress/utils/vizPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const V1_PLUGINS = [
'word_cloud',
'pie',
'table',
'big_number',
'big_number_total',
];
export const DASHBOARD_CHART_ALIAS_PREFIX = 'getChartData_';

Expand Down
7 changes: 4 additions & 3 deletions superset-frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ module.exports = {
coverageReporters: ['lcov', 'json-summary', 'html'],
transform: {
'^.+\\.jsx?$': 'babel-jest',
// ts-jest can't load plugin 'babel-plugin-typescript-to-proptypes'
'reactify\\.tsx$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
// ts-jest doesn't work with `--coverage`. @superset-ui/core should
// 100% coverage, so we use babel-jest in packages and plugins.
'(plugins|packages)\\/.+\\.tsx?$': 'babel-jest',
'(((?!(plugins|packages)).)*)\\/.+\\.tsx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
snapshotSerializers: ['@emotion/jest/enzyme-serializer'],
Expand Down
Loading

0 comments on commit 4152dd4

Please sign in to comment.