You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/05 08:28:40 UTC

[GitHub] [arrow] jorisvandenbossche commented on pull request #10591: ARROW-13158: [Python] Fix StructScalar contains and repr with duplicate field names

jorisvandenbossche commented on pull request #10591:
URL: https://github.com/apache/arrow/pull/10591#issuecomment-873915328


   Any other comments here? (cc @kszucs)
   
   There is the issue of how we should handle "null" struct scalars:
   
   ```
   In [2]: s = pa.scalar(None, type=pa.struct([('a', pa.int64()), ('b', pa.float64())]))
   
   In [3]: s
   Out[3]: <pyarrow.StructScalar: None>
   
   In [4]: s['a']
   Out[4]: <pyarrow.Int64Scalar: None>
   ```
   
   The above is the current behaviour, where you can access a field of a null value, but so that doesn't distinguish from a scalar with null values in the fields:
   
   ```
   In [5]: s2 = pa.scalar({'a': None, 'b': None}, type=pa.struct([('a', pa.int64()), ('b', pa.float64())]))
   
   In [6]: s2
   Out[6]: <pyarrow.StructScalar: {'a': None, 'b': None}>
   
   In [7]: s2['a']
   Out[7]: <pyarrow.Int64Scalar: None>
   ```
   
   But I would leave that discussion out of this PR, I think this PR already fixes some issues and is useful on its own.
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org