fails to compile as Clone method returns base DataFrameColumn class
2) User is able to create inheritor of DataFrameColumn without overriding Clone() method. Adding such columns to DataFrame brokes it functionality at runtime, as it will crashes with NotImplemented exception. Code should force user to implement all required essential methods
3) StringDataFrameColumn, ArrowStringDataFrameColumn and VBufferDataFrameColumn provides their own private Clone and CloneImplementation methods, so it's really hard to understand what method would be actually called, it very error prone. For example, PrimitiveDataFrameColumn provides:
public PrimitiveDataFrameColumn<T> Clone(PrimitiveDataFrameColumn<long> mapIndices = null, bool invertMapIndices = false)
and also it inherits from the base class
public virtual DataFrameColumn Clone(DataFrameColumn mapIndices = null, bool invertMapIndices = false, long numberOfNullsToAppend = 0)
so the call to Clone() without providing any arguments looks ambiguous
The fact, that in addition it has
public PrimitiveDataFrameColumn<T> Clone(IEnumerable<long> mapIndices)
taking into account, that PrimitiveDataFrameColumn implements IEnumerable and inherits from DataFrameColumn makes the situation even worse
4) InvertMapIndices argument doesn't have any sence in case if mapIndices is null or not provided. So ability to call method Clone(invertMapIndices: true) is logicaly incorrect
1) API of Clone method for String dataframe columns is inconsistent with other columns
It's possible to have code like this:
However
or
fails to compile as Clone method returns base DataFrameColumn class
2) User is able to create inheritor of DataFrameColumn without overriding Clone() method. Adding such columns to DataFrame brokes it functionality at runtime, as it will crashes with NotImplemented exception. Code should force user to implement all required essential methods
3) StringDataFrameColumn, ArrowStringDataFrameColumn and VBufferDataFrameColumn provides their own private Clone and CloneImplementation methods, so it's really hard to understand what method would be actually called, it very error prone. For example, PrimitiveDataFrameColumn provides:
and also it inherits from the base class
so the call to Clone() without providing any arguments looks ambiguous
The fact, that in addition it has
taking into account, that PrimitiveDataFrameColumn implements IEnumerable and inherits from DataFrameColumn makes the situation even worse
4) InvertMapIndices argument doesn't have any sence in case if mapIndices is null or not provided. So ability to call method
Clone(invertMapIndices: true)
is logicaly incorrect