duckdblabs/duckplyr

Support factors

Opened this issue · 3 comments

I know this is a known issue, but it I feel like it could do with an issue for tracking purposes.

Replication:

> duckplyr:::duckdb_rel_from_df(iris)
Error in duckplyr:::duckdb_rel_from_df(iris) : 
  Can't convert factor columns to relational. Affected column: `Species`.

Factor support could be implemented via enum types, no? Or, am I missing something obvious?

Doing some digging it looks like there was a missing feature in duckdb, which made it complicated, but that bug is now solved! Hopefully factors can be enabled soon.

While we can add support for factors, enabling this will almost certainly unlock test failures that were hidden before because we had a fallback as soon as factors were present.

Action items:

  • Enable
  • Fix internal tests
  • Run revdepchecks, fix