You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dinesh-zemoso (via GitHub)" <gi...@apache.org> on 2023/06/13 06:01:50 UTC

[GitHub] [superset] dinesh-zemoso opened a new pull request, #24373: Initial-commit

dinesh-zemoso opened a new pull request, #24373:
URL: https://github.com/apache/superset/pull/24373

   <!---
   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] john-bodley commented on a diff in pull request #24373: Use static (uploaded) image as dashboard thumbnail

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #24373:
URL: https://github.com/apache/superset/pull/24373#discussion_r1230043242


##########
superset/migrations/versions/2023-06-12_19-01_11ac45e193d3_added_static_image_for_dashboard_.py:
##########
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""added_static_image_for_dashboard_thumbnail
+
+Revision ID: 11ac45e193d3
+Revises: 4ea966691069
+Create Date: 2023-06-12 19:01:18.714940
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '11ac45e193d3'
+down_revision = '4ea966691069'
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.add_column('dashboards', sa.Column('static_image', sa.String(), nullable=True))
+    # ### end Alembic commands ###
+
+def downgrade():
+    pass

Review Comment:
   Please add a downgrade which restores the table to its previous state.



##########
superset/config.py:
##########
@@ -436,13 +436,13 @@ class D3Format(TypedDict, total=False):
     # and doesn't work with all nested types.
     "PRESTO_EXPAND_DATA": False,
     # Exposes API endpoint to compute thumbnails
-    "THUMBNAILS": False,
+    "THUMBNAILS": True,

Review Comment:
   @dinesh-zemoso you probably don't want to change the default configuration. You can refer to the documentation in CONTRIBUTING.md regarding how to provide local overrides.



-- 
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] rusackas commented on pull request #24373: Use static (uploaded) image as dashboard thumbnail

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

   @dinesh-zemoso just checking in to see if you're able to follow through on this. Thanks in advance!


-- 
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] john-bodley commented on a diff in pull request #24373: Use static (uploaded) image as dashboard thumbnail

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #24373:
URL: https://github.com/apache/superset/pull/24373#discussion_r1272479600


##########
superset/config.py:
##########
@@ -645,8 +645,10 @@ class D3Format(TypedDict, total=False):
 THUMBNAIL_CHART_DIGEST_FUNC: Optional[Callable[[Slice, ExecutorType, str], str]] = None
 
 THUMBNAIL_CACHE_CONFIG: CacheConfig = {
-    "CACHE_TYPE": "NullCache",
-    "CACHE_NO_NULL_WARNING": True,
+    'CACHE_TYPE': 'redis',
+    'CACHE_DEFAULT_TIMEOUT': 24*60*60*7,

Review Comment:
   Could you use the `timedelta` instead ([example](https://github.com/apache/superset/blob/b8a3eeffdbfd6db852510ac409e4852fbac2f52c/superset/config.py#L952)) to improve readability.



##########
superset/config.py:
##########
@@ -645,8 +645,10 @@ class D3Format(TypedDict, total=False):
 THUMBNAIL_CHART_DIGEST_FUNC: Optional[Callable[[Slice, ExecutorType, str], str]] = None
 
 THUMBNAIL_CACHE_CONFIG: CacheConfig = {
-    "CACHE_TYPE": "NullCache",
-    "CACHE_NO_NULL_WARNING": True,
+    'CACHE_TYPE': 'redis',

Review Comment:
   See my previous comment.



##########
superset/config.py:
##########
@@ -1317,7 +1319,7 @@ def EMAIL_HEADER_MUTATOR(  # pylint: disable=invalid-name,unused-argument
 WEBDRIVER_OPTION_ARGS = ["--headless"]
 
 # The base URL to query for accessing the user interface
-WEBDRIVER_BASEURL = "http://0.0.0.0:8080/"
+WEBDRIVER_BASEURL = "http://localhost:8088/"

Review Comment:
   See my previous comment.



##########
superset/config.py:
##########
@@ -1296,7 +1298,7 @@ def EMAIL_HEADER_MUTATOR(  # pylint: disable=invalid-name,unused-argument
 # chrome:
 #   Requires: headless chrome
 #   Limitations: unable to generate screenshots of elements
-WEBDRIVER_TYPE = "firefox"
+WEBDRIVER_TYPE = "chrome"

Review Comment:
   See my previous comment.



##########
superset/models/dashboard.py:
##########
@@ -160,6 +160,7 @@ class Dashboard(Model, AuditMixinNullable, ImportExportMixin):
     published = Column(Boolean, default=False)
     is_managed_externally = Column(Boolean, nullable=False, default=False)
     external_url = Column(Text, nullable=True)
+    static_image = Column(Text, nullable=True)

Review Comment:
   Shouldn't this be a `BLOB` (or similar) if we're storing a binary object. Additionally could you talk to any performance concerns this could have, i.e., the payload for fetching a record will likely increase significantly.
   
   I'm not sure if having a separate table to house these images makes more sense. 
   
   cc @betodealmeida @michael-s-molina



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