You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "eddelbuettel (via GitHub)" <gi...@apache.org> on 2023/09/12 16:20:46 UTC

[GitHub] [arrow-nanoarrow] eddelbuettel commented on issue #296: Argument `ordered` in `na_dictionary` is always ignored

eddelbuettel commented on issue #296:
URL: https://github.com/apache/arrow-nanoarrow/issues/296#issuecomment-1716038325

   I guess this is a related shortcoming.  Turning a `factor` (that should be / can be `ordered`) into `ordered` leads to what seems like an incorrect schema print as the ordered flag is ignored -- flag should be 3 not 2.
   
   ```r
   > pclass <- as.ordered(earth::etitanic$pclass)
   > str(pclass)
    Ord.factor w/ 3 levels "1st"<"2nd"<"3rd": 1 1 1 1 1 1 1 1 1 1 ...
   > infer_nanoarrow_schema(pclass)
   <nanoarrow_schema dictionary(int32)<string>>
    $ format    : chr "i"
    $ name      : chr ""
    $ metadata  : list()
    $ flags     : int 2
    $ children  : list()
    $ dictionary:<nanoarrow_schema string>
     ..$ format    : chr "u"
     ..$ name      : chr ""
     ..$ metadata  : list()
     ..$ flags     : int 2
     ..$ children  : list()
     ..$ dictionary: NULL
   > 
   ```


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