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 2021/02/10 02:08:19 UTC

[GitHub] [superset] betodealmeida opened a new pull request #13041: fix: timeout decorator in Windows

betodealmeida opened a new pull request #13041:
URL: https://github.com/apache/superset/pull/13041


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   We currently use a decorator to timeout queries that run in SQL Lab, eg:
   
   ```python
   with utils.timeout(seconds=timeout, error_message=timeout_msg):
       data = sql_lab.get_sql_results(...)
   ```
   
   The decorator uses `SIGALRM`, which is not available in Windows, resulting in an error (see https://github.com/apache/superset/issues/12824).
   
   Even though Windows is not technically supported, this is a simple fix. I introduced a new timeout decorator based on a timer.  This PR changes Superset to use that decorator only when running on Windows. In theory we could replace the old one, but I thought it would be safer to introduce the new one in parallel first.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   N/A
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   I installed Python under a Windows VPS and tested the decorator with this script:
   
   ```python
   # test.py
   import _thread
   import threading
   
   
   class Timeout:
       def __init__(self, seconds: int = 1, error_message: str = "Timeout") -> None:
           self.seconds = seconds
           self.error_message = error_message
           self.timer = threading.Timer(self.seconds, _thread.interrupt_main)
   
       def __enter__(self) -> None:
           self.timer.start()
   
       def __exit__(self, type, value, traceback) -> None:
           if type is KeyboardInterrupt:
               raise Exception(self.error_message)
   
   
   with Timeout():
       for i in range(int(1e15)):
           pass
   ```
   
   (I didn't use `sleep()` because the `_thread.interrupt_main` doesn't interrupt it.)
   
   Then running it causes the main thread to be aborted after 1 second:
   
   ```
   C:\Users\Administrator\Documents>powershell -Command "Measure-Command {python test.py}"
   Traceback (most recent call last):
     File "C:\Users\Administrator\Documents\test.py", line 21, in <module>
       pass
   KeyboardInterrupt
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "C:\Users\Administrator\Documents\test.py", line 21, in <module>
       pass
     File "C:\Users\Administrator\Documents\test.py", line 16, in __exit__
       raise Exception(self.error_message)
   Exception: Timeout
   
   
   Days              : 0
   Hours             : 0
   Minutes           : 0
   Seconds           : 1
   Milliseconds      : 463
   Ticks             : 14631515
   TotalDays         : 1.69346238425926E-05
   TotalHours        : 0.000406430972222222
   TotalMinutes      : 0.0243858583333333
   TotalSeconds      : 1.4631515
   TotalMilliseconds : 1463.1515
   
   
   
   
   C:\Users\Administrator\Documents>
   ```
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: https://github.com/apache/superset/issues/12824
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] 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.

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] [superset] betodealmeida merged pull request #13041: fix: timeout context manager on Windows

Posted by GitBox <gi...@apache.org>.
betodealmeida merged pull request #13041:
URL: https://github.com/apache/superset/pull/13041


   


----------------------------------------------------------------
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] [superset] codecov-io commented on pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #13041:
URL: https://github.com/apache/superset/pull/13041#issuecomment-776403054


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=h1) Report
   > Merging [#13041](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=desc) (1a1ca4c) into [master](https://codecov.io/gh/apache/superset/commit/2ce79823dfad61bce6196fcacd56a844f44818c0?el=desc) (2ce7982) will **increase** coverage by `13.92%`.
   > The diff coverage is `57.14%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13041       +/-   ##
   ===========================================
   + Coverage   53.06%   66.98%   +13.92%     
   ===========================================
     Files         489      489               
     Lines       17314    28778    +11464     
     Branches     4482        0     -4482     
   ===========================================
   + Hits         9187    19278    +10091     
   - Misses       8127     9500     +1373     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | python | `66.98% <57.14%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.64% <ø> (ø)` | |
   | [...s/260bf0649a77\_migrate\_x\_dateunit\_in\_time\_range.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8yNjBiZjA2NDlhNzdfbWlncmF0ZV94X2RhdGV1bml0X2luX3RpbWVfcmFuZ2UucHk=) | `0.00% <0.00%> (ø)` | |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `87.55% <53.33%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `92.85% <77.77%> (ø)` | |
   | [superset/utils/date\_parser.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvZGF0ZV9wYXJzZXIucHk=) | `96.87% <100.00%> (ø)` | |
   | [...erset-frontend/src/SqlLab/components/SouthPane.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NvdXRoUGFuZS5qc3g=) | | |
   | [...set-frontend/src/explore/components/optionTypes.ts](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9vcHRpb25UeXBlcy50cw==) | | |
   | [superset-frontend/src/components/EditableTitle.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS50c3g=) | | |
   | [...rc/explore/components/controls/TextAreaControl.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9UZXh0QXJlYUNvbnRyb2wuanN4) | | |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | | |
   | ... and [968 more](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13041?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/superset/pull/13041?src=pr&el=footer). Last update [1a96102...1a1ca4c](https://codecov.io/gh/apache/superset/pull/13041?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] [superset] codecov-io edited a comment on pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13041:
URL: https://github.com/apache/superset/pull/13041#issuecomment-776403054


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=h1) Report
   > Merging [#13041](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=desc) (de45060) into [master](https://codecov.io/gh/apache/superset/commit/2ce79823dfad61bce6196fcacd56a844f44818c0?el=desc) (2ce7982) will **increase** coverage by `14.29%`.
   > The diff coverage is `68.62%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13041       +/-   ##
   ===========================================
   + Coverage   53.06%   67.36%   +14.29%     
   ===========================================
     Files         489      489               
     Lines       17314    28796    +11482     
     Branches     4482        0     -4482     
   ===========================================
   + Hits         9187    19397    +10210     
   - Misses       8127     9399     +1272     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | python | `67.36% <68.62%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.64% <ø> (ø)` | |
   | [...s/260bf0649a77\_migrate\_x\_dateunit\_in\_time\_range.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8yNjBiZjA2NDlhNzdfbWlncmF0ZV94X2RhdGV1bml0X2luX3RpbWVfcmFuZ2UucHk=) | `0.00% <0.00%> (ø)` | |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `87.55% <53.33%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `92.85% <77.77%> (ø)` | |
   | [superset/db\_engine\_specs/elasticsearch.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2VsYXN0aWNzZWFyY2gucHk=) | `89.74% <93.75%> (ø)` | |
   | [superset/utils/date\_parser.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvZGF0ZV9wYXJzZXIucHk=) | `96.87% <100.00%> (ø)` | |
   | [...tend/src/explore/components/ExploreChartHeader.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlQ2hhcnRIZWFkZXIuanN4) | | |
   | [.../src/explore/components/controls/BoundsControl.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9Cb3VuZHNDb250cm9sLmpzeA==) | | |
   | [...rontend/src/SqlLab/components/ShareSqlLabQuery.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NoYXJlU3FsTGFiUXVlcnkuanN4) | | |
   | [...components/nativeFilters/FilterBar/FilterValue.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlclZhbHVlLnRzeA==) | | |
   | ... and [965 more](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13041?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/superset/pull/13041?src=pr&el=footer). Last update [1a96102...5de0355](https://codecov.io/gh/apache/superset/pull/13041?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] [superset] villebro commented on a change in pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13041:
URL: https://github.com/apache/superset/pull/13041#discussion_r573494677



##########
File path: superset/utils/core.py
##########
@@ -749,6 +752,34 @@ def __exit__(  # pylint: disable=redefined-outer-name,unused-variable,redefined-
             logger.exception(ex)
 
 
+class TimerTimeout:
+    def __init__(self, seconds: int = 1, error_message: str = "Timeout") -> None:
+        self.seconds = seconds
+        self.error_message = error_message
+        self.timer = threading.Timer(seconds, _thread.interrupt_main)
+
+    def __enter__(self) -> None:
+        self.timer.start()
+
+    def __exit__(  # pylint: disable=redefined-outer-name,unused-variable,redefined-builtin
+        self, type: Any, value: Any, traceback: TracebackType
+    ) -> None:
+        self.timer.cancel()
+        if type is KeyboardInterrupt:  # raised by _thread.interrupt_main

Review comment:
       Surprised that this is a `KeyboardInterrupt`




----------------------------------------------------------------
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] [superset] codecov-io edited a comment on pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13041:
URL: https://github.com/apache/superset/pull/13041#issuecomment-776403054


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=h1) Report
   > Merging [#13041](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=desc) (5de0355) into [master](https://codecov.io/gh/apache/superset/commit/2ce79823dfad61bce6196fcacd56a844f44818c0?el=desc) (2ce7982) will **increase** coverage by `0.33%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13041      +/-   ##
   ==========================================
   + Coverage   53.06%   53.39%   +0.33%     
   ==========================================
     Files         489      489              
     Lines       17314    17315       +1     
     Branches     4482     4482              
   ==========================================
   + Hits         9187     9245      +58     
   + Misses       8127     8070      -57     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `53.39% <100.00%> (+0.33%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/components/ListView/CardSortSelect.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvQ2FyZFNvcnRTZWxlY3QudHN4) | `78.94% <ø> (ø)` | |
   | [...perset-frontend/src/views/CRUD/chart/ChartList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY2hhcnQvQ2hhcnRMaXN0LnRzeA==) | `79.81% <ø> (+5.50%)` | :arrow_up: |
   | [...rontend/src/views/CRUD/dashboard/DashboardCard.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGFzaGJvYXJkL0Rhc2hib2FyZENhcmQudHN4) | `76.00% <ø> (ø)` | |
   | [...rset-frontend/src/components/ListView/ListView.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvTGlzdFZpZXcudHN4) | `92.13% <100.00%> (+15.73%)` | :arrow_up: |
   | [...rontend/src/views/CRUD/dashboard/DashboardList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGFzaGJvYXJkL0Rhc2hib2FyZExpc3QudHN4) | `72.04% <100.00%> (+5.73%)` | :arrow_up: |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `84.34% <0.00%> (+0.86%)` | :arrow_up: |
   | [...set-frontend/src/dashboard/util/getDropPosition.js](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERyb3BQb3NpdGlvbi5qcw==) | `78.78% <0.00%> (+1.51%)` | :arrow_up: |
   | [superset-frontend/src/views/CRUD/hooks.ts](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvaG9va3MudHM=) | `57.22% <0.00%> (+2.77%)` | :arrow_up: |
   | ... and [5 more](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13041?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/superset/pull/13041?src=pr&el=footer). Last update [1a96102...927888f](https://codecov.io/gh/apache/superset/pull/13041?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] [superset] codecov-io edited a comment on pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13041:
URL: https://github.com/apache/superset/pull/13041#issuecomment-776403054


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=h1) Report
   > Merging [#13041](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=desc) (5de0355) into [master](https://codecov.io/gh/apache/superset/commit/2ce79823dfad61bce6196fcacd56a844f44818c0?el=desc) (2ce7982) will **decrease** coverage by `3.19%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13041      +/-   ##
   ==========================================
   - Coverage   53.06%   49.87%   -3.20%     
   ==========================================
     Files         489      489              
     Lines       17314    17315       +1     
     Branches     4482     4482              
   ==========================================
   - Hits         9187     8635     -552     
   - Misses       8127     8680     +553     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `49.87% <50.00%> (-3.20%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/components/ListView/CardSortSelect.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvQ2FyZFNvcnRTZWxlY3QudHN4) | `78.94% <ø> (ø)` | |
   | [...rset-frontend/src/components/ListView/ListView.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvTGlzdFZpZXcudHN4) | `82.02% <0.00%> (+5.61%)` | :arrow_up: |
   | [...perset-frontend/src/views/CRUD/chart/ChartList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY2hhcnQvQ2hhcnRMaXN0LnRzeA==) | `73.39% <ø> (-0.92%)` | :arrow_down: |
   | [...rontend/src/views/CRUD/dashboard/DashboardCard.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGFzaGJvYXJkL0Rhc2hib2FyZENhcmQudHN4) | `0.00% <ø> (-76.00%)` | :arrow_down: |
   | [...rontend/src/views/CRUD/dashboard/DashboardList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGFzaGJvYXJkL0Rhc2hib2FyZExpc3QudHN4) | `69.89% <100.00%> (+3.58%)` | :arrow_up: |
   | [...uperset-frontend/src/components/PopoverSection.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUG9wb3ZlclNlY3Rpb24uanN4) | `25.00% <0.00%> (-75.00%)` | :arrow_down: |
   | [.../src/explore/components/controls/BoundsControl.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9Cb3VuZHNDb250cm9sLmpzeA==) | `12.12% <0.00%> (-69.70%)` | :arrow_down: |
   | [...end/src/views/CRUD/data/database/DatabaseModal.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9kYXRhYmFzZS9EYXRhYmFzZU1vZGFsLnRzeA==) | `3.44% <0.00%> (-65.52%)` | :arrow_down: |
   | [...tend/src/views/CRUD/data/database/DatabaseList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9kYXRhYmFzZS9EYXRhYmFzZUxpc3QudHN4) | `4.70% <0.00%> (-63.53%)` | :arrow_down: |
   | ... and [41 more](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13041?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/superset/pull/13041?src=pr&el=footer). Last update [1a96102...927888f](https://codecov.io/gh/apache/superset/pull/13041?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] [superset] codecov-io edited a comment on pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13041:
URL: https://github.com/apache/superset/pull/13041#issuecomment-776403054


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=h1) Report
   > Merging [#13041](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=desc) (5de0355) into [master](https://codecov.io/gh/apache/superset/commit/2ce79823dfad61bce6196fcacd56a844f44818c0?el=desc) (2ce7982) will **decrease** coverage by `0.03%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13041      +/-   ##
   ==========================================
   - Coverage   53.06%   53.02%   -0.04%     
   ==========================================
     Files         489      489              
     Lines       17314    17315       +1     
     Branches     4482     4482              
   ==========================================
   - Hits         9187     9181       -6     
   - Misses       8127     8134       +7     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `53.02% <100.00%> (-0.04%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/components/ListView/CardSortSelect.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvQ2FyZFNvcnRTZWxlY3QudHN4) | `78.94% <ø> (ø)` | |
   | [...perset-frontend/src/views/CRUD/chart/ChartList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY2hhcnQvQ2hhcnRMaXN0LnRzeA==) | `79.81% <ø> (+5.50%)` | :arrow_up: |
   | [...rontend/src/views/CRUD/dashboard/DashboardCard.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGFzaGJvYXJkL0Rhc2hib2FyZENhcmQudHN4) | `76.00% <ø> (ø)` | |
   | [...rset-frontend/src/components/ListView/ListView.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvTGlzdFZpZXcudHN4) | `92.13% <100.00%> (+15.73%)` | :arrow_up: |
   | [...rontend/src/views/CRUD/dashboard/DashboardList.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGFzaGJvYXJkL0Rhc2hib2FyZExpc3QudHN4) | `72.04% <100.00%> (+5.73%)` | :arrow_up: |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   | [superset-frontend/src/reduxUtils.ts](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3JlZHV4VXRpbHMudHM=) | `52.17% <0.00%> (-11.60%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/TabbedSqlEditors.jsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmJlZFNxbEVkaXRvcnMuanN4) | `53.41% <0.00%> (-7.46%)` | :arrow_down: |
   | [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `18.44% <0.00%> (-5.46%)` | :arrow_down: |
   | [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `12.70% <0.00%> (-4.92%)` | :arrow_down: |
   | ... and [10 more](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13041?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/superset/pull/13041?src=pr&el=footer). Last update [1a96102...927888f](https://codecov.io/gh/apache/superset/pull/13041?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] [superset] codecov-io edited a comment on pull request #13041: fix: timeout context manager on Windows

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13041:
URL: https://github.com/apache/superset/pull/13041#issuecomment-776403054


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=h1) Report
   > Merging [#13041](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=desc) (0b978ff) into [master](https://codecov.io/gh/apache/superset/commit/2ce79823dfad61bce6196fcacd56a844f44818c0?el=desc) (2ce7982) will **increase** coverage by `13.93%`.
   > The diff coverage is `57.14%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13041       +/-   ##
   ===========================================
   + Coverage   53.06%   66.99%   +13.93%     
   ===========================================
     Files         489      489               
     Lines       17314    28794    +11480     
     Branches     4482        0     -4482     
   ===========================================
   + Hits         9187    19291    +10104     
   - Misses       8127     9503     +1376     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | python | `66.99% <57.14%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13041?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.64% <ø> (ø)` | |
   | [...s/260bf0649a77\_migrate\_x\_dateunit\_in\_time\_range.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8yNjBiZjA2NDlhNzdfbWlncmF0ZV94X2RhdGV1bml0X2luX3RpbWVfcmFuZ2UucHk=) | `0.00% <0.00%> (ø)` | |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `87.55% <53.33%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `92.85% <77.77%> (ø)` | |
   | [superset/utils/date\_parser.py](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvZGF0ZV9wYXJzZXIucHk=) | `96.87% <100.00%> (ø)` | |
   | [...t-frontend/src/dashboard/util/setPeriodicRunner.ts](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL3NldFBlcmlvZGljUnVubmVyLnRz) | | |
   | [...et-frontend/src/components/ConfirmStatusChange.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29uZmlybVN0YXR1c0NoYW5nZS50c3g=) | | |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | | |
   | [...perset-frontend/src/dashboard/util/findParentId.js](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2ZpbmRQYXJlbnRJZC5qcw==) | | |
   | [...ore/components/controls/DateFilterControl/utils.ts](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC91dGlscy50cw==) | | |
   | ... and [968 more](https://codecov.io/gh/apache/superset/pull/13041/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13041?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/superset/pull/13041?src=pr&el=footer). Last update [1a96102...0b978ff](https://codecov.io/gh/apache/superset/pull/13041?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] [superset] betodealmeida commented on a change in pull request #13041: fix: timeout decorator on Windows

Posted by GitBox <gi...@apache.org>.
betodealmeida commented on a change in pull request #13041:
URL: https://github.com/apache/superset/pull/13041#discussion_r573822728



##########
File path: superset/utils/core.py
##########
@@ -749,6 +752,34 @@ def __exit__(  # pylint: disable=redefined-outer-name,unused-variable,redefined-
             logger.exception(ex)
 
 
+class TimerTimeout:
+    def __init__(self, seconds: int = 1, error_message: str = "Timeout") -> None:
+        self.seconds = seconds
+        self.error_message = error_message
+        self.timer = threading.Timer(seconds, _thread.interrupt_main)
+
+    def __enter__(self) -> None:
+        self.timer.start()
+
+    def __exit__(  # pylint: disable=redefined-outer-name,unused-variable,redefined-builtin
+        self, type: Any, value: Any, traceback: TracebackType
+    ) -> None:
+        self.timer.cancel()
+        if type is KeyboardInterrupt:  # raised by _thread.interrupt_main

Review comment:
       Me too!




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