villebro commented on code in PR #21931: URL: https://github.com/apache/superset/pull/21931#discussion_r1007753132
########## superset/reports/commands/execute.py: ########## @@ -77,11 +77,24 @@ logger = logging.getLogger(__name__) -def _get_user() -> User: - user = security_manager.find_user(username=app.config["THUMBNAIL_SELENIUM_USER"]) - if not user: - raise ReportScheduleSelleniumUserNotFoundError() - return user +def _get_user(report_schedule: ReportSchedule) -> User: + user_types = app.config["ALERT_REPORTS_EXECUTE_AS"] + for user_type in user_types: + if user_type == "selenium": Review Comment: I usually opt for `Literal` in the case of config flags, as using an `Enum` requires adding an import which is an added inconvenience. But let me see if mypy is ok assigning a string value to something that is extending `(str, Enum)` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
