potiuk commented on code in PR #25787:
URL: https://github.com/apache/airflow/pull/25787#discussion_r1003417209
##########
airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -301,36 +301,39 @@ def create_custom_object(
):
"""
Creates custom resource definition object in Kubernetes
-
:param group: api group
:param version: api version
:param plural: api plural
:param body: crd object definition
:param namespace: kubernetes namespace
"""
api = client.CustomObjectsApi(self.api_client)
+
if namespace is None:
namespace = self.get_namespace()
- if isinstance(body, str):
- body_dict = _load_body_to_dict(body)
- else:
- body_dict = body
Review Comment:
The rule of thumb here is that if possible - such changes should be separted
out. This makes it easier for cherry-picking (in case we decide to cherry-pick
your change to 2.4 branch it might cause unnecessary conflicts that we will
have to resolve. So I suggest you split that change out into a separate PR.
This is basically the rule that everyone shoudl follow - when you make a
bugfix or change, avoid doing unrelated refactoring and separate it out to a
separate PR. We are continiuously doing it and while it des not always work, it
is something we strive for.
This is much more important for Airlfow's and Core provider's code - because
it allows cherry-picking and produces much better changelogs (we use commit
messages to automatically generate changelog. So this is rather justified
requirement that has very good reasons and I kindly ask you to follow that.
--
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]