You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/06/16 16:28:04 UTC
[GitHub] [incubator-superset] etr2460 opened a new pull request #10068: chore: type src/dashboard/util/charts
etr2460 opened a new pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068
### SUMMARY
As titled. Related to https://github.com/apache/incubator-superset/issues/10004
### TEST PLAN
CI
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Requires DB Migration.
- [ ] Confirm DB Migration upgrade and downgrade tested.
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
to: @graceguo-supercat @ktmud @nytai @rusackas
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] etr2460 commented on a change in pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#discussion_r441201509
##########
File path: superset-frontend/src/dashboard/util/charts/getEffectiveExtraFilters.ts
##########
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-export default function getEffectiveExtraFilters(filters) {
+export default function getEffectiveExtraFilters(filters: Record<string, any>) {
Review comment:
Updated, TS can automagically infer the return type, so ExtraFilter wasn't required
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] codecov-commenter commented on pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#issuecomment-645043944
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=h1) Report
> Merging [#10068](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/d3a9ce5afc46ff45adb63f6f06856fa6a29f865c&el=desc) will **decrease** coverage by `10.97%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10068/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #10068 +/- ##
===========================================
- Coverage 70.49% 59.52% -10.98%
===========================================
Files 585 401 -184
Lines 31073 12876 -18197
Branches 3185 3186 +1
===========================================
- Hits 21905 7664 -14241
+ Misses 9058 5034 -4024
- Partials 110 178 +68
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `59.52% <100.00%> (+0.01%)` | :arrow_up: |
| #python | `?` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../dashboard/util/charts/getEffectiveExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRFZmZlY3RpdmVFeHRyYUZpbHRlcnMudHM=) | `100.00% <100.00%> (ø)` | |
| [...shboard/util/charts/getFormDataWithExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRGb3JtRGF0YVdpdGhFeHRyYUZpbHRlcnMudHM=) | `95.00% <100.00%> (ø)` | |
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [325 more](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=footer). Last update [d3a9ce5...3cbd422](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] ktmud commented on a change in pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#discussion_r441204996
##########
File path: superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
##########
@@ -25,16 +25,24 @@ import getEffectiveExtraFilters from './getEffectiveExtraFilters';
const cachedFiltersByChart = {};
const cachedFormdataByChart = {};
+interface GetFormDataWithExtraFiltersArguments {
+ chart: Record<string, any>;
Review comment:
I think it'd be valuable to add specific typings as early as possible, so it can help future work down the road. The more specific the early typing is, the more it helps your second step.
If it's hard to find all the props, maybe start with known props + `[key: string]: unknown`:
```ts
import { ChartProps } from '@superset-ui/chart';
import { chart } from 'src/chart/chartReducer';
type ChartReducerInitialState = typeof chart;
// chart query built from initialState
// Ref: https://github.com/apache/incubator-superset/blob/dcac860f3e5528ecbc39e58f045c7388adb5c3d0/superset-frontend/src/dashboard/reducers/getInitialState.js#L120
interface ChartQueryPayload extends ChartReducerInitialState {
id: number;
formData: ChartProps['formData'];
form_data: ChartProps['RawFormData'];
[key: string]: unknown;
}
```
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] etr2460 commented on a change in pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#discussion_r441197345
##########
File path: superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
##########
@@ -25,16 +25,24 @@ import getEffectiveExtraFilters from './getEffectiveExtraFilters';
const cachedFiltersByChart = {};
const cachedFormdataByChart = {};
+interface GetFormDataWithExtraFiltersArguments {
+ chart: Record<string, any>;
Review comment:
I don't think we're at a point where it matches any existing types yet... My plan was to only start adding specific param types once needed to get typing to work. Then, as these were added, I'd expect other files to start failing without specific enough types. Finally, once everything is typed, we can go through and clean up unknowns, anys, and Records.
Thoughts?
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] codecov-commenter edited a comment on pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#issuecomment-645043944
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=h1) Report
> Merging [#10068](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/d3a9ce5afc46ff45adb63f6f06856fa6a29f865c&el=desc) will **decrease** coverage by `4.83%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10068/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #10068 +/- ##
==========================================
- Coverage 70.49% 65.66% -4.84%
==========================================
Files 585 585
Lines 31073 31076 +3
Branches 3185 3186 +1
==========================================
- Hits 21905 20405 -1500
- Misses 9058 10493 +1435
- Partials 110 178 +68
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `59.52% <100.00%> (+0.01%)` | :arrow_up: |
| #python | `70.00% <ø> (-0.07%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../dashboard/util/charts/getEffectiveExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRFZmZlY3RpdmVFeHRyYUZpbHRlcnMudHM=) | `100.00% <100.00%> (ø)` | |
| [...shboard/util/charts/getFormDataWithExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRGb3JtRGF0YVdpdGhFeHRyYUZpbHRlcnMudHM=) | `95.00% <100.00%> (ø)` | |
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [145 more](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=footer). Last update [d3a9ce5...3cbd422](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] codecov-commenter edited a comment on pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#issuecomment-645043944
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=h1) Report
> Merging [#10068](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/d3a9ce5afc46ff45adb63f6f06856fa6a29f865c&el=desc) will **decrease** coverage by `0.23%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10068/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #10068 +/- ##
==========================================
- Coverage 70.49% 70.25% -0.24%
==========================================
Files 585 585
Lines 31073 31076 +3
Branches 3185 3186 +1
==========================================
- Hits 21905 21833 -72
- Misses 9058 9128 +70
- Partials 110 115 +5
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `53.06% <100.00%> (-0.83%)` | :arrow_down: |
| #javascript | `59.52% <100.00%> (+0.01%)` | :arrow_up: |
| #python | `70.00% <ø> (-0.07%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../dashboard/util/charts/getEffectiveExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRFZmZlY3RpdmVFeHRyYUZpbHRlcnMudHM=) | `100.00% <100.00%> (ø)` | |
| [...shboard/util/charts/getFormDataWithExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRGb3JtRGF0YVdpdGhFeHRyYUZpbHRlcnMudHM=) | `95.00% <100.00%> (ø)` | |
| [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset-frontend/src/reduxUtils.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3JlZHV4VXRpbHMudHM=) | `70.88% <0.00%> (-8.87%)` | :arrow_down: |
| [...rontend/src/SqlLab/components/QueryAutoRefresh.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1F1ZXJ5QXV0b1JlZnJlc2guanN4) | `65.90% <0.00%> (-6.82%)` | :arrow_down: |
| [...rontend/src/SqlLab/components/TabbedSqlEditors.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmJlZFNxbEVkaXRvcnMuanN4) | `75.52% <0.00%> (-6.30%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `61.13% <0.00%> (-5.03%)` | :arrow_down: |
| [...rontend/src/SqlLab/components/SqlEditorLeftBar.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIuanN4) | `44.00% <0.00%> (-4.00%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `37.44% <0.00%> (-3.30%)` | :arrow_down: |
| ... and [9 more](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=footer). Last update [d3a9ce5...3cbd422](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] ktmud commented on a change in pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#discussion_r441207137
##########
File path: superset-frontend/src/dashboard/util/charts/getEffectiveExtraFilters.ts
##########
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-export default function getEffectiveExtraFilters(filters) {
+export default function getEffectiveExtraFilters(filters: Record<string, any>) {
Review comment:
It's more for the use in other functions, but up to you.
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] ktmud commented on a change in pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#discussion_r441195944
##########
File path: superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
##########
@@ -25,16 +25,24 @@ import getEffectiveExtraFilters from './getEffectiveExtraFilters';
const cachedFiltersByChart = {};
const cachedFormdataByChart = {};
+interface GetFormDataWithExtraFiltersArguments {
+ chart: Record<string, any>;
Review comment:
I'm wondering whether `chart` matches any existing types? If not, can we create a new interface in `src/dashboard/types.ts` and slowly expand it?
##########
File path: superset-frontend/src/dashboard/util/charts/getEffectiveExtraFilters.ts
##########
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-export default function getEffectiveExtraFilters(filters) {
+export default function getEffectiveExtraFilters(filters: Record<string, any>) {
Review comment:
There is `DataRecordFilters` in `@superset-ui/chart` that should match `filters` here. And it'd be good to also create an `ExtraFilter` type:
```ts
import { DataRecordFilters, DataRecordValue } from "@superset-ui/chart";
interface ExtraFilter {
col: string;
op: 'in' | 'eq' | ...,
val: DataRecordValue[]
}
export default function getEffectiveExtraFilters(filters: DataRecordFilters): ExtraFilter[] {
```
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] ktmud commented on a change in pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#discussion_r441204996
##########
File path: superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
##########
@@ -25,16 +25,24 @@ import getEffectiveExtraFilters from './getEffectiveExtraFilters';
const cachedFiltersByChart = {};
const cachedFormdataByChart = {};
+interface GetFormDataWithExtraFiltersArguments {
+ chart: Record<string, any>;
Review comment:
I think it'd be valuable to add specific typings as early as possible, so it can help future work down the road. The more specific the early typing is, the more it helps your second step.
If this doesn't work, maybe start with known props + `[key: string]: unknown`:
```ts
import { ChartProps } from '@superset-ui/chart';
import { chart } from 'src/chart/chartReducer';
type ChartReducerInitialState = typeof chart;
// chart query built from initialState
// Ref: https://github.com/apache/incubator-superset/blob/dcac860f3e5528ecbc39e58f045c7388adb5c3d0/superset-frontend/src/dashboard/reducers/getInitialState.js#L120
interface ChartQueryPayload extends ChartReducerInitialState {
id: number;
formData: ChartProps['formData'];
form_data: ChartProps['RawFormData'];
[key: string]: unknown;
}
```
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] etr2460 commented on pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
etr2460 commented on pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#issuecomment-645557482
@ktmud updated/addressed comments. Needed to make some things optional for now, but will clean up further in the future
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] codecov-commenter edited a comment on pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068#issuecomment-645043944
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=h1) Report
> Merging [#10068](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/d3a9ce5afc46ff45adb63f6f06856fa6a29f865c&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10068/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #10068 +/- ##
==========================================
- Coverage 70.49% 70.46% -0.03%
==========================================
Files 585 585
Lines 31073 31076 +3
Branches 3185 3186 +1
==========================================
- Hits 21905 21898 -7
- Misses 9058 9069 +11
+ Partials 110 109 -1
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `53.91% <100.00%> (+0.02%)` | :arrow_up: |
| #javascript | `59.52% <100.00%> (+0.01%)` | :arrow_up: |
| #python | `70.00% <ø> (-0.07%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../dashboard/util/charts/getEffectiveExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRFZmZlY3RpdmVFeHRyYUZpbHRlcnMudHM=) | `100.00% <100.00%> (ø)` | |
| [...shboard/util/charts/getFormDataWithExtraFilters.ts](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRGb3JtRGF0YVdpdGhFeHRyYUZpbHRlcnMudHM=) | `95.00% <100.00%> (ø)` | |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [.../src/dashboard/components/gridComponents/Chart.jsx](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0LmpzeA==) | `88.76% <0.00%> (-1.13%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `85.42% <0.00%> (-0.88%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `76.13% <0.00%> (-0.20%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `88.80% <0.00%> (-0.15%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10068/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `66.81% <0.00%> (+0.65%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=footer). Last update [d3a9ce5...3cbd422](https://codecov.io/gh/apache/incubator-superset/pull/10068?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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
[GitHub] [incubator-superset] ktmud merged pull request #10068: chore: type src/dashboard/util/charts
Posted by GitBox <gi...@apache.org>.
ktmud merged pull request #10068:
URL: https://github.com/apache/incubator-superset/pull/10068
----------------------------------------------------------------
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.
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