Yikun edited a comment on pull request #32821:
URL: https://github.com/apache/spark/pull/32821#issuecomment-857331260


   > Would you consider moving null checks methods to DataTypeOps?
   
   @xinrong-databricks  I thought the Series already has null check method, so 
I didn't have plan to add null check in Ops.
   
   I am a little confusion about how to make sure `DecimalType could not have 
Nan` in DataTypeOps. Do you mean we need do strict `null checks` before every 
method called in **DecimalOps** (like add, sub) to make sure left and right is 
not Nan? something like
   
   ```python
   def __add__(self, other) -> Union["Series", "Index"]:
       if isinstance(self._dtype_op, DecimalOps]:
           if self.isnan or other.isnan:
               raise ValueError("Decimal left or right shouldn't be Nan")
       return self._dtype_op.add(self, other)
   ```
   That means if we use the decimal type will do pre-check before every 
decimalops.
   
   So, would you mind to give some more background about end2end case? Thanks!


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to