You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dpgaspar (via GitHub)" <gi...@apache.org> on 2023/02/21 17:05:44 UTC

[GitHub] [superset] dpgaspar opened a new pull request, #23139: fix: [WiP] memoized decorator memory leak

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### 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


[GitHub] [superset] codecov[bot] commented on pull request #23139: fix: [WiP] memoized decorator memory leak

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23139](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7394afc) into [master](https://codecov.io/gh/apache/superset/commit/eb8386e3f0647df6d1bbde8b42073850796cc16f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eb8386e) will **decrease** coverage by `9.62%`.
   > The diff coverage is `45.43%`.
   
   > :exclamation: Current head 7394afc differs from pull request most recent head c649191. Consider uploading reports for the commit c649191 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #23139      +/-   ##
   ==========================================
   - Coverage   65.81%   56.19%   -9.62%     
   ==========================================
     Files        1881     1897      +16     
     Lines       72398    73025     +627     
     Branches     7882     7945      +63     
   ==========================================
   - Hits        47647    41039    -6608     
   - Misses      22729    29950    +7221     
   - Partials     2022     2036      +14     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | presto | `52.71% <56.19%> (?)` | |
   | python | `58.90% <56.19%> (-19.76%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `52.54% <55.37%> (?)` | |
   
   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=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ackages/superset-ui-core/src/utils/featureFlags.ts](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvdXRpbHMvZmVhdHVyZUZsYWdzLnRz) | `100.00% <ø> (ø)` | |
   | [...rontend/src/views/CRUD/allentities/AllEntities.tsx](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxsZW50aXRpZXMvQWxsRW50aXRpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...nd/src/views/CRUD/allentities/AllEntitiesTable.tsx](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxsZW50aXRpZXMvQWxsRW50aXRpZXNUYWJsZS50c3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/views/CRUD/tags/TagCard.tsx](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvdGFncy9UYWdDYXJkLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/views/CRUD/tags/TagList.tsx](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvdGFncy9UYWdMaXN0LnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [superset/constants.py](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uc3RhbnRzLnB5) | `100.00% <ø> (ø)` | |
   | [superset/models/datasource\_access\_request.py](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2RhdGFzb3VyY2VfYWNjZXNzX3JlcXVlc3QucHk=) | `51.85% <ø> (-1.72%)` | :arrow_down: |
   | [superset-frontend/src/tags.ts](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3RhZ3MudHM=) | `13.72% <13.72%> (ø)` | |
   | [superset/tags/models.py](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFncy9tb2RlbHMucHk=) | `55.73% <20.00%> (-32.70%)` | :arrow_down: |
   | [superset-frontend/src/components/Tags/utils.tsx](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFncy91dGlscy50c3g=) | `21.05% <21.05%> (ø)` | |
   | ... and [381 more](https://codecov.io/gh/apache/superset/pull/23139?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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


[GitHub] [superset] knowvishnu commented on a diff in pull request #23139: fix: memoized decorator memory leak

Posted by "knowvishnu (via GitHub)" <gi...@apache.org>.
knowvishnu commented on code in PR #23139:
URL: https://github.com/apache/superset/pull/23139#discussion_r1151423814


##########
superset/models/slice.py:
##########
@@ -151,9 +150,12 @@ def clone(self) -> "Slice":
 
     # pylint: disable=using-constant-test
     @datasource.getter  # type: ignore
-    @memoized
     def get_datasource(self) -> Optional["BaseDatasource"]:
-        return db.session.query(self.cls_model).filter_by(id=self.datasource_id).first()
+        return (
+            db.session.query(self.cls_model)
+            .filter_by(id=self.datasource_id)
+            .one_or_none()

Review Comment:
   why did we replace `first()` with `one_or_none()` ?



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


[GitHub] [superset] EugeneTorap commented on pull request #23139: fix: memoized decorator memory leak

Posted by "EugeneTorap (via GitHub)" <gi...@apache.org>.
EugeneTorap commented on PR #23139:
URL: https://github.com/apache/superset/pull/23139#issuecomment-1440410663

   Thanks for this PR!


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


[GitHub] [superset] dpgaspar merged pull request #23139: fix: memoized decorator memory leak

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


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