PolinaFam commented on code in PR #34051:
URL: https://github.com/apache/superset/pull/34051#discussion_r2194774620


##########
superset/models/helpers.py:
##########
@@ -546,10 +546,28 @@ def changed_on_utc(self) -> str:
 
     @property
     def changed_on_humanized(self) -> str:
+        locale = str(get_locale() or 'en')
+        try:
+            humanize.i18n.activate(locale)
+            result = humanize.naturaltime(datetime.now() - self.changed_on)
+            humanize.i18n.deactivate()
+            return result
+        except:

Review Comment:
   There is only one case to fail is missing locale in `humanize`. Added 
logging for missing locale and handle default humanize `en` locale as 
humanize.i18n.activate('en') will throw exception.



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

Reply via email to