potiuk commented on code in PR #28627:
URL: https://github.com/apache/airflow/pull/28627#discussion_r1058830142
##########
airflow/cli/commands/info_command.py:
##########
@@ -155,12 +156,16 @@ class Architecture:
ARM = "arm"
@staticmethod
- def get_current():
+ def get_current() -> Architecture:
"""Get architecture."""
- return _MACHINE_TO_ARCHITECTURE.get(platform.machine().lower())
+ current_architecture =
_MACHINE_TO_ARCHITECTURE.get(platform.machine().lower())
+ if current_architecture:
+ return current_architecture
+ else:
+ raise RuntimeError(f"Unknown architecture for machine:
{platform.machine()}")
Review Comment:
Right. I changed it and added UNKNOWN returned instead and removed the
conditional (It was in one place). Also I noticed that OperatingSystem was
similar and I changed it into Enum as well (there we had to use "UNKNOWN"
because it was more likely we will have some unhandled platform.
--
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]