How to add metadata info to a DataFrame?

I don’t think that’s the case. There’s no reason why you would be more likely to attach meta-data like a description or a unit to a CategoricalArray than to any other kind of array.

I think in theory attaching meta-data to column vectors is a superior approach, but that in practice it’s currently much less clear. @pdeffebach hits the nail on the head when noting that Julia doesn’t currently allow delegating all method calls to the wrapped object: we can only delegate methods we know about, or use the AbstractArray interface, but custom methods beyond that won’t work at all. That’s probably something which will improve at some point as it’s frequently mentioned as a problem. But in the short term the question is: is the current system good enough? Maybe that’s OK if we typically expect people to only wrap Vector and CategoricalVector in MetaDataVectors. But if we expect to support many different kinds of arrays, it’s going to be much more problematic (and adding some code in DataFrames to store meta-data will then be much easier).

For reference, the previous discussion on GitHub is here.

1 Like