You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2024/03/05 22:38:15 UTC

[PR] fix: typescript errors in 4.0 [superset]

justinpark opened a new pull request, #27402:
URL: https://github.com/apache/superset/pull/27402

   ### SUMMARY
   This fixes the a bunch of typescript errors in `4.0`.
   
   1. makeApi.ts
   ```
   @superset-ui/core/src/query/api/v1/makeApi.ts:118:38 - error TS2352: Conversion of type 'Payload' to type 'URLSearchParams' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
   
   118         requestConfig.searchParams = payload as URLSearchParams;
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   @superset-ui/core/src/query/api/v1/makeApi.ts:122:37 - error TS2352: Conversion of type 'Payload' to type 'FormData' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
   
   122         requestConfig.postPayload = payload as FormData;
                                           ~~~~~~~~~~~~~~~~~~~
   ```
   
   2. AlteredSliceTagMocks.ts
   ```
   superset-frontend/src/components/AlteredSliceTag/AlteredSliceTagMocks.ts:20:36 - error TS2307: Cannot find module 'packages/superset-ui-chart-controls/src/types' or its corresponding type declarations.
   
   20 import { ControlPanelConfig } from 'packages/superset-ui-chart-controls/src/types';
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ```
   
   3. AlteredSliceTag/index.tsx
   ```
   superset-frontend/src/components/AlteredSliceTag/index.tsx:184:15 - error TS2339: Property 'comparator' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'comparator' does not exist on type 'string'.
   
   184             v.comparator && v.comparator.constructor === Array
                     ~~~~~~~~~~
   
   superset-frontend/src/components/AlteredSliceTag/index.tsx:184:31 - error TS2339: Property 'comparator' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'comparator' does not exist on type 'string'.
   
   184             v.comparator && v.comparator.constructor === Array
                                     ~~~~~~~~~~
   
   superset-frontend/src/components/AlteredSliceTag/index.tsx:185:23 - error TS2339: Property 'comparator' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'comparator' does not exist on type 'string'.
   
   185               ? `[${v.comparator.join(', ')}]`
                             ~~~~~~~~~~
   
   superset-frontend/src/components/AlteredSliceTag/index.tsx:186:19 - error TS2339: Property 'comparator' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'comparator' does not exist on type 'string'.
   
   186               : v.comparator;
                         ~~~~~~~~~~
   
   ../../../apache-superset/superset-frontend/src/components/AlteredSliceTag/index.tsx:187:23 - error TS2339: Property 'subject' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'subject' does not exist on type 'string'.
   
   187           return `${v.subject} ${v.operator} ${filterVal}`;
                             ~~~~~~~
   
   superset-frontend/src/components/AlteredSliceTag/index.tsx:187:36 - error TS2339: Property 'operator' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'operator' does not exist on type 'string'.
   
   187           return `${v.subject} ${v.operator} ${filterVal}`;
                                          ~~~~~~~~
   
   superset-frontend/src/components/AlteredSliceTag/index.tsx:201:48 - error TS2339: Property 'label' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'label' does not exist on type 'string'.
   
   201       const formattedValue = value.map(v => v?.label ?? v);
                                                      ~~~~~
   
   superset-frontend/src/components/AlteredSliceTag/index.tsx:208:48 - error TS2339: Property 'label' does not exist on type 'string | number | FilterItemType | Record<string | number, any>'.
     Property 'label' does not exist on type 'string'.
   
   208       const formattedValue = value.map(v => v?.label ?? v);
                                                      ~~~~~
   ```
   
   4. TelemetryPixel/index.tsx
   
   ```
   superset-frontend/src/components/TelemetryPixel/index.tsx:50:7 - error TS2322: Type '"no-referrer-when-downgrade"' is not assignable to type '"no-referrer" | "origin" | "unsafe-url" | undefined'.
   
   50       referrerPolicy="no-referrer-when-downgrade"
            ~~~~~~~~~~~~~~
   
     superset-frontend/node_modules/@types/react/index.d.ts:2046:9
       2046         referrerPolicy?: "no-referrer" | "origin" | "unsafe-url";
                    ~~~~~~~~~~~~~~
   ```
   
   ### TESTING INSTRUCTIONS
   npm run type
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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


Re: [PR] fix: typescript errors in 4.0 [superset]

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley merged PR #27402:
URL: https://github.com/apache/superset/pull/27402


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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


Re: [PR] fix: typescript errors in 4.0 [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #27402:
URL: https://github.com/apache/superset/pull/27402#issuecomment-1979785382

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/27402?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `75.00000%` with `1 lines` in your changes are missing coverage. Please review.
   > Project coverage is 67.34%. Comparing base [(`721977a`)](https://app.codecov.io/gh/apache/superset/commit/721977a4745e8b6aa5d8e6d1b898069764cc11a6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`08fb88d`)](https://app.codecov.io/gh/apache/superset/pull/27402?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 2 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/superset/pull/27402?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...-frontend/src/components/AlteredSliceTag/index.tsx](https://app.codecov.io/gh/apache/superset/pull/27402?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL2luZGV4LnRzeA==) | 50.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/27402?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #27402      +/-   ##
   ==========================================
   - Coverage   67.34%   67.34%   -0.01%     
   ==========================================
     Files        1909     1909              
     Lines       74592    74600       +8     
     Branches     8320     8323       +3     
   ==========================================
   + Hits        50235    50236       +1     
   - Misses      22305    22312       +7     
     Partials     2052     2052              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/27402/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/27402/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.21% <75.00%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/27402?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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