jose-lpa commented on code in PR #29760:
URL: https://github.com/apache/airflow/pull/29760#discussion_r1117921298


##########
airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py:
##########
@@ -378,22 +378,16 @@ def _render_nested_template_fields(
         seen_oids: set,
     ) -> None:
         if id(content) not in seen_oids:
-            template_fields: tuple | None = None
-
-            if isinstance(content, k8s.V1EnvVar):
-                template_fields = ("value", "name")
-
-            if isinstance(content, k8s.V1ResourceRequirements):
-                template_fields = ("limits", "requests")
-
-            if isinstance(content, k8s.V1Volume):
-                template_fields = ("name", "persistent_volume_claim")
-
-            if isinstance(content, k8s.V1VolumeMount):
-                template_fields = ("name",)
-
-            if isinstance(content, k8s.V1PersistentVolumeClaimVolumeSource):
-                template_fields = ("claim_name",)
+            try:

Review Comment:
   I'm sincerely sorry that this PR was bothering you instead of helping or 
adding any improvement at all, which was my only intention.
   
   > _Generally, you should only bother to optimize code if you really need to_
   
   I have read that, and I would reply to him that if somebody else comes to my 
codebase and proves that a single function could be significantly improved with 
a very simple change, I will just follow the advice. Because that is very 
different than **me** _bothering to optimize code_ (read: "spending my own time 
reviewing the entire codebase and **trying** to find improvements"). It's 
definitely a different scenario: it's someone helping to improve my code for 
free.
   
   I thought that the improvement was clear and simple enough to be considered, 
as it's so evident that the current implementation is performing multiple extra 
operations that could be dismissed, and adding instead a loop to iterate over 
multiple cases is definitely not the best choice - you can do that with 
`elif`'s and don't need to do any loop. 
   
   Finally, I understand being a maintainer of such big project is not easy. 
This PR was just trying to contribute somehow to open source on my free time - 
I saw the code before this week, trying to debug some issue I had. I'm not here 
to argue or waste my (and **yours**) time with discussions. You are the person 
in charge and the last one to decide, not me. I've explained enough my PR. If 
it's not appreciated, or is causing more trouble than help, just close the PR 
and the issue and that's all. I won't be pushing for it anymore.
   
   Apologies again if you were annoyed for anything I said before.
   
   Cheers, have a good weekend.



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

Reply via email to