Skip to content

Conversation

@gkahiu
Copy link
Collaborator

@gkahiu gkahiu commented Nov 11, 2025

Addresses #700.

@gkahiu gkahiu added this to the Phase 5 milestone Nov 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

🚀 Plugin Build Successful!

A new plugin build has been successfully generated for the changes in this pull request! 🎉

🔗 Download Plugin Zip 📥

📌 Next Steps

  • 📥 Download and test the plugin built from this pull request.
  • 🔄 Review the changes and validate functionality.
  • 📝 Provide feedback on this pull request!

🛠 Powered by GitHub Actions & gh API

@gkahiu gkahiu requested a review from zamuzakki November 11, 2025 11:02
@gkahiu gkahiu marked this pull request as ready for review November 11, 2025 11:02
and format.
:rtype: str
"""
if not self.updated_date or self.updated_date == "":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The or self.updated_date == "" is redundant — not self.updated_date already covers None and empty string.
Simplify to

if not self.updated_date:
    return ""

local_dt = utc_dt.astimezone()

try:
locale.setlocale(locale.LC_TIME, "")
Copy link
Collaborator

@zamuzakki zamuzakki Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locale.setlocale(locale.LC_TIME, "") modifies the global process locale, which can have side effects if other threads or components rely on locale settings.

Please revert the locale

try:
    current_locale = locale.getlocale(locale.LC_TIME)
    locale.setlocale(locale.LC_TIME, "")
    formatted_date = local_dt.strftime("%x")
    formatted_time = local_dt.strftime("%H:%M")
finally:
    locale.setlocale(locale.LC_TIME, current_locale)

return False

self.set_status_message(
f"Zonal statistics calculation started, task id: {task_uuid})"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ')' at the end

# Repeatedly poll until final status
try:
while not self.isCanceled():
response = pooling.results()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If results is somehow None due to some unexpected error, it could raise an error.
We can change it to

response = pooling.results() or {}
status_str = response.get("status")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants