r-richmond commented on issue #14396:
URL: https://github.com/apache/airflow/issues/14396#issuecomment-786194069


   >Not really. We are not planning to add anything to the context any time 
soon. and even if we do it's the same for dict/field. If someone extends data 
class with a new field the problem is the same.
   
   >`A safer way for maintainers to add new fields to context`
   > Not really. it's the same kind of problems you get.
   
   I don't follow here. In the V2 dataclass design users would add stuff to the 
`user_defined` field which has no chance of collision with anything airflow 
adds later to the base dataclass. The same can't be said for dicts. What am I 
missing?
   
   > `A clean way to implement deprecation warnings with detailed warning 
messages about potential silent bugs`
   We do not need deprecation warnings in case we do not change from Dict
   
   True regarding the deprecation warning, but isn't their value in warning 
users about doing things could cause bugs? (i.e. overwriting the wrong keys in 
context).
   
   > `More flexibility down the road (dataclasses are more flexible than 
dictionaries)`
   This sentence is meaningless. I argue that dicts are more flexible and 
probably we would both be right.
   
   I like the meet in the middle vibe but I kind of cheated with the 
`user_defined` field being a dict which I think pushes dataclass to the winners 
column.
   
   > `A solution that is easier to maintain in the future`
   Again - meaningless - maintenance is also to go trough the hassle of 
changing and informing users.
   
   I think we are just stuck on 2 different points here, you rightly point to 
the burden of migrating users and I'm stuck on what I perceive are the 
long-term benefits of switching (safer modifications, better IDE integration 
usability improvements, warning users about things that could cause bugs).
   
   
   > `Or said another way we shouldn't optimize for airflow 2.x maintainability 
we should optimize for airflow maintainability.`
   I do not agree. I carefully weighted pros/cons and as maintainer i agree 
with @kaxil TypedDict is much better solution and we will have no plans to 
change to Dataclass. You have not convinced us.
   
   I'm just a user so apologies if I came across as forceful. It is clear we 
have a difference of opinion in which case the maintainer usually and rightly 
decides upon the path forward for the project. 
   
   Lastly at this point I'm gonna slow down on this topic for a while to allow 
other users & maintainers a chance to give their opinion/thoughts.
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to