Skip to content

Type information for RunGroupBy.apply() #258

@mikapfl

Description

@mikapfl

Is your feature request related to a problem? Please describe.

I get the error:

error: Call to untyped function "apply" in typed context  [no-untyped-call]

if I use run.groupby(…).apply(…). That's a bit sad.

Describe the solution you'd like

It would be great to add type information to RunGroupBy.apply(), however that's not really possible because there would be a dependency cycle: run.groupby() returns a RunGroupBy object (and therefore has to import scmdata.groupby), and RunGroupBy.apply() return an ScmRun object (and therefore has to import scmdata.run).

I'm not sure how to properly solve this.

Describe alternatives you've considered

We could:

  • dump everything into one file, no dependency cycles ever
  • Protocolize ScmRun. Sounds painful and like a lot of work, but would decouple implementation and types clearly.
  • Protocolize RunGroupBy. Probably less work, but I'm not sure if run.py can live without importing scmdata.groupby, so probably doesn't break the cycle?
  • Other ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions