-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[AIRFLOW-5048] Improve display of Kubernetes resources #5665
Conversation
airflow/kubernetes/pod.py
Outdated
@@ -37,6 +37,10 @@ def has_limits(self): | |||
def has_requests(self): | |||
return self.request_cpu is not None or self.request_memory is not None | |||
|
|||
def __str__(self): | |||
return str({'request': {'memory': self.request_memory, 'cpu': self.request_cpu}, |
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.
self.request_memory
can be None, may be check first?
same for self.limit_memory
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.
true, the test covers this, None
to string is 'None'
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.
We've just merged GPU limits as well so you should add them.
Tests fail on python 3.5 |
I think now they will fail on python 3.6 I am afraid. You should use OrderedDict if you want to maintain order @ms32035 |
I'll go for a simpler solution instead of trying to have dict ordering solution compatible with both 3.5 and 3.6 |
@potiuk current test failures are not related to the change |
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.
@potiuk this all LGTM but I'll hold off unless you have any other concerns.
(cherry picked from commit 4dfe249)
Make sure you have checked all steps below.
Jira
Description
At the moment just a serialized class is displayed in task instance view. This PR improves string conversion
Tests
test_display_resources
Commits
Documentation
Code Quality
flake8