-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use static (uploaded) image as dashboard thumbnail #24373
base: master
Are you sure you want to change the base?
Use static (uploaded) image as dashboard thumbnail #24373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I’ve added a few comments (regarding the Python logic) and enabled CI—which surfaced some issues.
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
# ### end Alembic commands ### | ||
|
||
def downgrade(): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a downgrade which restores the table to its previous state.
@dinesh-zemoso just checking in to see if you're able to follow through on this. Thanks in advance! |
"CACHE_TYPE": "NullCache", | ||
"CACHE_NO_NULL_WARNING": True, | ||
'CACHE_TYPE': 'redis', | ||
'CACHE_DEFAULT_TIMEOUT': 24*60*60*7, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the timedelta
instead (example) to improve readability.
@@ -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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment.
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment.
@@ -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/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment.
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
SUMMARY
User can choose a static image as the dashboard thumbnail
Here is the discussion link : #18872
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION