dstandish commented on a change in pull request #19572:
URL: https://github.com/apache/airflow/pull/19572#discussion_r774690071



##########
File path: airflow/providers/cncf/kubernetes/CHANGELOG.rst
##########
@@ -19,6 +19,19 @@
 Changelog
 ---------
 
+3.0.0
+.....
+
+Breaking changes
+~~~~~~~~~~~~~~~~
+
+* ``Simplify KubernetesPodOperator (#19572)``
+
+.. warning:: Many methods in :class:`~.KubernetesPodOperator` and 
class:`~.PodLauncher` have been renamed.
+    If you have subclassed :class:`~.KubernetesPodOperator` will need to 
update your subclass to reflect
+    the new structure. Additionally ``PodStatus`` enum has been renamed to 
``PodPhase``.

Review comment:
       re table with renames, i am not sure how helpful it would be cus in some 
cases it's not simply renaming but also changing what they are doing.  but i 
will look into the issue.
   
   it took a look at the metaclass thing
   
   can be done like so:
   
   ```python
   class Meta(type):
       def __new__(cls, name, bases, dct):
           x = super().__new__(cls, name, bases, dct)
           bad_attrs = ['start_pod']
           for attr in bad_attrs:
               if hasattr(x, attr):
                   raise ValueError(
                       f'Method names in  KPO have changed; you are 
implementing a removed method {attr!r}. Please review the changes.'
                   )
           return x
   
   
   class NewKPO(metaclass=Meta):
       pass
   
   
   class SubKPO(NewKPO):
       def start_pod(self):
           print('hi')
   ```
   
   it doesn't seem like a bad idea.  only issue i guess is if a user wants, in 
a subclass, to introduce those methods for some reason. then they can't. _(or 
can't without a warning. i checked and it seems in a subclass even if you 
change the metaclass, you don't change the metaclass of the parent class 
---which actually makes sense)_
   




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