Skip to content

Can no longer subclass DataFrameColumn due to internal abstract GetSortIndices method #7323

Closed

Description

@charliebone

Hello,

I'm glad v0.22 is published with some fixes I have been waiting for. However, there is now an issue.

I inherit from the DataFrameColumn class to build my own DataFrameColumn implementation. The reasons aren't super important but it's used allow for some implementations of extension methods on the DataFrameColumn class that do computations that require certain data types. The class is a public abstract class, which indicated to me as a user of the ml.net library it was fair game to override and to continue writing extension methods that all were based on the DataFrameColumn abstract base class.

Now, we have an internal abstract method present in the base class, making overriding impossible even though every other abstract method and property is either public or protected:

internal abstract PrimitiveDataFrameColumn<long> GetSortIndices(bool ascending, bool putNullValuesLast);

Is there anything that can be done to remedy this?

Activity

  1. changed the title [-]Can no longer implement DataFrameColumn due to internal abstract GetSortIndices method[/-] [+]Can no longer subclass DataFrameColumn due to internal abstract GetSortIndices method[/+] on Nov 20, 2024
  2. asmirnov82 commented on Nov 20, 2024

    @asmirnov82
    Contributor

    Hi @charliebone. I implemented fix for this.
    You may try to inherit from the PrimitiveDataFrameColumn class as a workaround, if it's possible in your scenario (though T should be a value type)

  3. charliebone commented on Nov 20, 2024

    @charliebone
    Author

    Hi @asmirnov82, thank you for the prompt reply and fix! Any idea when it'll make it out into the wild?

    I have considered inheriting from PrimitiveDataFrame instead, and perhaps I'll go that route in the interim. Thanks again for the fast fix!

  4. asmirnov82 commented on Dec 7, 2024

    @asmirnov82
    Contributor

    @charliebone, I created PR #7331 for including these changes to the 4.0.1 release. I don't have any insights when it may be shipped to production, vut according to previouse years I expect it to happen in the nearest couple of months

  5. locked and limited conversation to collaborators on Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-prA pull request is open to resolve this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions